美文网首页
设置cell的分割线为0(ios8)

设置cell的分割线为0(ios8)

作者: has | 来源:发表于2017-06-23 23:15 被阅读7次

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

{

   if (indexPath.section != 2) {

       return;

   }

   if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {

       [cell setSeparatorInset:UIEdgeInsetsZero];

   }

   if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {

       [cell setPreservesSuperviewLayoutMargins:NO];

   }

   if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

       [cell setLayoutMargins:UIEdgeInsetsZero];

   }

}

相关文章

网友评论

      本文标题:设置cell的分割线为0(ios8)

      本文链接:https://www.haomeiwen.com/subject/dvshcxtx.html