ios7的表格和ios6下显示不一致的问题 self.automaticallyAdjustsScrollViewInsets = NO; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 坑爹的IOS,自身的兼容性都做不好 按照您的方法,第(1)个小问题解决了,但第(2)个小问题仍不能解决设置cell的border color 第2个问题,可以试着增加边框宽度:_tableView.layer.borderWidth = 1.0f ]self.automaticallyAdjustsScrollViewInsets = NO;设置这句应该可以解决这个问题,也许是你设置的位置不对。不过实际上在iOs7里除非不得以,不然最好不要设置automaticallyAdjustsScrollViewInsets = NO。因为在iOs7里各Controller的层次发生了改变,而且NavigationBar还有自动毛玻璃效果等。比如在iOs6中 tableview.frame = cgrectmake(0,0,self.view.frame.size.width,self.view.frame.size.height);实际上在iOs7中继续可以这样设置,因为automaticallyAdjustsScrollViewInsets会自动设置tableview的contentInset为合适的区域。如果需要手工调整可视可滚动区域,则类似这样设置就可以了:if (IS_IOS_7) { UIEdgeInsets contentInset = UIEdgeInsetsMake(tableView.contentInset.top , 0.0f , tableView.contentInset.bottom + 24.0f , 0.0f); tableView.contentInset = contentInset; tableView.scrollIndicatorInsets = contentInset; } 看了您的回答,第2个小问题解决了。由于自己水平有限,有个问题还请您解答一下。 之前我的app实际上有二个表格,分别在不同的UIViewController中。 第一个UIViewController中的tableView是在放在一个UIScrollView中,这个UIScrollView中就只有一个tableView控件,没有其他控件,如下图(第一图)所示。设置automaticallyAdjustsScrollViewInsets = NO时,tableview上方不会出现空白,显示正常。 而第二个UIViewController也只一个UIScrollView,而这个UIScrollView中有一个UIImageView和一个tableview,如下图(第二图)所示。 此时,无论设置automaticallyAdjustsScrollViewInsets = NO,还是依照您的 if (IS_IOS_7) { UIEdgeInsets contentInset = UIEdgeInsetsMake(tableView.contentInset.top , 0.0f , tableView.contentInset.bottom + 24.0f , 0.0f); tableView.contentInset = contentInset; tableView.scrollIndicatorInsets = contentInset; } 结果tableview上方和下方还是有空白,不正常,如下图(第三图)所示。为何automaticallyAdjustsScrollViewInsets = NO对第一图的上方空白可以消除,而第三图中的表格上方空白不能消除呢? IOS7 的版本很有问题啊,控件都不像在6和5中正常显示啦 self.automaticallyAdjustsScrollViewInsets = NO 只会对ViewController的第一层ScrollView起作用。按你的需求,你可以试试这个:if (IS_IOS_7) { UIEdgeInsets contentInset = UIEdgeInsetsMake(0 , 0.0f , 0 , 0.0f); tableView.contentInset = contentInset; tableView.scrollIndicatorInsets = contentInset; } 楼主,这张图里的tableView 的group 模式是在ios7里的么 如果是的话 怎么实现的和ios6的group相同的... 这不是group模式,只是在ios7中是默认是直角,一定要把边角设为圆角,方法如下: view.layer.cornerRadius=4; view.clipsToBounds=YES; 根据版主的提示,自己不断调整UIEdgeInsetsMake和tableview的frame,终于使表格上下方不再有空白出现了。 感谢大家的关注,特别是版主的关注,困拢我以久的问题终于得以解决。 关于IPHONE做web的问题 请问 ASIFormDataRequest 在那个头文件里? 新手上路 javaEE转ios,求建议 如果应用程序闪退,我可以获取到应用程序或者本机的一些信息吗 uivew用backgroundColor让背景图片居中,求大神 Iphone6Plus自动适配 XCode Socket中文传输问题(乱码,可能是编码错误) iOS git Xcode7 ruby 请问实现全景图片3d效果浏览怎么实现? GCDAsyncSocket类TCP连接发送数据粘包怎么办 swift网络请求http://bbs.csdn.net/topics/390804115
_tableView.layer.borderWidth = 1.0f
self.automaticallyAdjustsScrollViewInsets = NO;
设置这句应该可以解决这个问题,也许是你设置的位置不对。不过实际上在iOs7里除非不得以,不然最好不要设置automaticallyAdjustsScrollViewInsets = NO。因为在iOs7里各Controller的层次发生了改变,而且NavigationBar还有自动毛玻璃效果等。
比如在iOs6中 tableview.frame = cgrectmake(0,0,self.view.frame.size.width,self.view.frame.size.height);实际上在iOs7中继续可以这样设置,因为automaticallyAdjustsScrollViewInsets会自动设置tableview的contentInset为合适的区域。如果需要手工调整可视可滚动区域,则类似这样设置就可以了:if (IS_IOS_7) {
UIEdgeInsets contentInset = UIEdgeInsetsMake(tableView.contentInset.top , 0.0f , tableView.contentInset.bottom + 24.0f , 0.0f);
tableView.contentInset = contentInset;
tableView.scrollIndicatorInsets = contentInset;
}
之前我的app实际上有二个表格,分别在不同的UIViewController中。
第一个UIViewController中的tableView是在放在一个UIScrollView中,这个UIScrollView中就只有一个tableView控件,没有其他控件,如下图(第一图)所示。设置automaticallyAdjustsScrollViewInsets = NO时,tableview上方不会出现空白,显示正常。
而第二个UIViewController也只一个UIScrollView,而这个UIScrollView中有一个UIImageView和一个tableview,如下图(第二图)所示。 此时,无论设置automaticallyAdjustsScrollViewInsets = NO,还是依照您的
if (IS_IOS_7) {
UIEdgeInsets contentInset = UIEdgeInsetsMake(tableView.contentInset.top , 0.0f , tableView.contentInset.bottom + 24.0f , 0.0f);
tableView.contentInset = contentInset;
tableView.scrollIndicatorInsets = contentInset;
}
结果tableview上方和下方还是有空白,不正常,如下图(第三图)所示。为何automaticallyAdjustsScrollViewInsets = NO对第一图的上方空白可以消除,而第三图中的表格上方空白不能消除呢?
UIEdgeInsets contentInset = UIEdgeInsetsMake(0 , 0.0f , 0 , 0.0f);
tableView.contentInset = contentInset;
tableView.scrollIndicatorInsets = contentInset;
}
view.layer.cornerRadius=4;
view.clipsToBounds=YES;
感谢大家的关注,特别是版主的关注,困拢我以久的问题终于得以解决。