UITableViewCell分割線位置調整

而知無涯發表於2018-03-06

1.cell分割線兩邊位置調整,如:頂格、間距大小控制

cell.separatorInset = UIEdgeInsetsZero;
cell.layoutMargins = UIEdgeInsetsZero;
cell.preservesSuperviewLayoutMargins = NO;
複製程式碼

2.控制某一行cell分割線不顯示

#define TT_SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width

cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, TT_SCREEN_WIDTH);
cell.layoutMargins = UIEdgeInsetsMake(0, 0, 0, TT_SCREEN_WIDTH);
cell.preservesSuperviewLayoutMargins = NO;
複製程式碼

相關文章