您的位置:首页 > 产品设计 > UI/UE

设置tableview的cell的两边满格 分割线

2016-10-14 15:47 267 查看
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

// cell的分割线从0坐标开始

// Remove seperator inset

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

[cell setSeparatorInset:UIEdgeInsetsZero];

}

// Prevent the cell from inheriting the Table View's margin settings

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

[cell setPreservesSuperviewLayoutMargins:NO];

}

// Explictly set your cell's layout margins

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

[cell setLayoutMargins:UIEdgeInsetsZero];

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息