美文网首页
设置UITableView的setSeparatorInset

设置UITableView的setSeparatorInset

作者: 不舍 | 来源:发表于2016-03-16 09:55 被阅读662次

if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
}

  • (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
    [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
    [cell setLayoutMargins:UIEdgeInsetsZero];
    }

}

相关文章

网友评论

      本文标题:设置UITableView的setSeparatorInset

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