160113ios 7分割线(separator)不到左边框的问题和去掉底部多余的表格线

来源:互联网 发布:耳机一定要煲机吗 知乎 编辑:程序博客网 时间:2024/04/29 21:36

1.分割线(separator)不到左边框的问题

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{    // 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];    }}
2,

//去掉底部多余的表格线

[tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
0 0
原创粉丝点击