ios - Remove separator line for only one cell -
i'm trying remove separator 1 uitableviewcell
. did following:
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell; cell = [super tableview:tableview cellforrowatindexpath:indexpath]; if (indexpath.row == 1) cell.separatorinset = uiedgeinsetszero; return cell; }
(it's static cells
.) when run app. separator line still there. how can remove separator line 1 cell
?
on ios 8 need use:
cell.layoutmargins = uiedgeinsetszero
if want compatible ios 7 should following:
if ([cell respondstoselector:@selector(setseparatorinset:)]) { [cell setseparatorinset:uiedgeinsetszero]; } if ([cell respondstoselector:@selector(setlayoutmargins:)]) { [cell setlayoutmargins:uiedgeinsetszero]; }
add: if previous didn't work - use this. (from answer below)
cell.separatorinset = uiedgeinsetsmake(0, 1000, 0, 0);
Comments
Post a Comment