一般设置cell时使用? ??
cell.separatorInset = UIEdgeInsetsMake(top, left, bottom, right);
?但此方法不能使分割线对齐屏幕嘴左边
?
在tableView代理中设置可以是分割线左对齐
- (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];
}
if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
}
?
原文:http://2914905399.iteye.com/blog/2310532