self.automaticallyAdjustsScrollViewInsets = NO; 

解决方案 »

  1.   

    坑爹的IOS,自身的兼容性都做不好
      

  2.   

    按照您的方法,第(1)个小问题解决了,但第(2)个小问题仍不能解决设置cell的border color
      

  3.   

    第2个问题,可以试着增加边框宽度:
    _tableView.layer.borderWidth = 1.0f
      

  4.   

    ]
    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;
        }
      

  5.   

     看了您的回答,第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对第一图的上方空白可以消除,而第三图中的表格上方空白不能消除呢?    
      

  6.   

    IOS7 的版本很有问题啊,控件都不像在6和5中正常显示啦       
      

  7.   

    self.automaticallyAdjustsScrollViewInsets = NO 只会对ViewController的第一层ScrollView起作用。按你的需求,你可以试试这个:if (IS_IOS_7) {
            UIEdgeInsets contentInset = UIEdgeInsetsMake(0 , 0.0f , 0 , 0.0f);
            tableView.contentInset = contentInset;
            tableView.scrollIndicatorInsets = contentInset;
        }
      

  8.   

    楼主,这张图里的tableView  的group 模式是在ios7里的么   如果是的话 怎么实现的和ios6的group相同的...  
      

  9.   

         这不是group模式,只是在ios7中是默认是直角,一定要把边角设为圆角,方法如下:
            view.layer.cornerRadius=4;
           view.clipsToBounds=YES;
      

  10.   

             根据版主的提示,自己不断调整UIEdgeInsetsMake和tableview的frame,终于使表格上下方不再有空白出现了。
            感谢大家的关注,特别是版主的关注,困拢我以久的问题终于得以解决。