------------------
ios
ios7基于viewController隐藏状态条:
经过ViewController重载方法返回枚举值的方法来控制状态栏的隐藏和样式。
首先,须要在Info.plist配置文件中,增长键:UIViewControllerBasedStatusBarAppearance,并设置为YES;
而后,在UIViewController子类中实现如下两个方法:spa
- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } - (BOOL)prefersStatusBarHidden { return NO; }
最后,在须要刷新状态栏样式的时候,调用[self setNeedsStatusBarAppearanceUpdate]方法便可刷新指针
UILable奇葩的把文字draw到外面去了:
lable在ios7(bate版)下能够draw多行,只要text里有回车,若是你计算出单行text的高度并setFrame以后,对于"1\n2"这样的文本,他的显示就错乱了,1跑上面去了——出了frame区域,解决方法就是setFrame以后调用:[label sizeThatFits:lable.frame.size].code
UITabBarController的视图结构变了:(这是由于kpi么)对象
-------
blog
IOS7的UITableViewCell的定制没有之前那么直接了,之前能够直接继承UITableViewCell而后drawRect. 可是如今不行了,如今的UITableViewCell包含了一个scrollView,你重绘了UITableViewCell将会被这个scrollView遮住而彻底无法显示.继承
以下是一个解决思路:事件
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath内存
{it
UITableViewCell * cell = [[[UITableViewCellalloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
UIView * subview = [[[XXView alloc] init] autorelease];
subview.userInteractionEnabled = NO;// 不设为NO会屏蔽cell的点击事件
subview.backgroundColor = [UIColorclearColor];// 设为透明从而使得cell.backgroundColor有效.
subview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:subview];// cell.contentView是个readonly属性,因此别想着替换contentView了.
return cell;
}
UISearchDisplayController的delegate致使内存问题
连这个问题都有。。不得不感慨乔布斯死的早啊!
这显示是ios7的(pre-)sdk本身的一个bug,给UISearchDisplayController设置delegate后,在UISearchDisplayController不用了的时候(好比release他以前),务必要setDelegate = nil. 不然可能会出野指针(某已释放的对象)被调用.
self.searchDisplay.delegate = nil;