首页 > 其他 > 详细

UITableViewCell 顶格

时间:2015-04-21 11:04:27      阅读:273      评论:0      收藏:0      [点我收藏+]
  1. 首先在ViewDidLoad 或者ViewWillAppear里边写
     1 if ([_tabView respondsToSelector:@selector(setSeparatorInset:)]) {
     2         
     3         [_tabView setSeparatorInset:UIEdgeInsetsZero];
     4         
     5     }
     6     if ([_tabView respondsToSelector:@selector(setLayoutMargins:)]) {
     7         
     8         [_tabView setLayoutMargins:UIEdgeInsetsZero];
     9         
    10     }

     

  2. 然后在cellForRowIndexPath或者是Display里边加上
     1 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
     2     
     3     
     4     if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
     5         
     6         [cell setSeparatorInset:UIEdgeInsetsZero];
     7         
     8     }
     9     
    10     if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
    11         
    12         [cell setLayoutMargins:UIEdgeInsetsZero];
    13     }
    14     
    15     
    16     
    17     
    18 }

    之后 cell 下边的 线条就可以顶格了

UITableViewCell 顶格

原文:http://www.cnblogs.com/MJJdyx/p/4443791.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!