First, write it in Viewdidload.
if ([Self.mytableview respondstoselector: @selector (setseparatorinset:)]) {
[Self.mytableview Setseparatorinset:uiedgeinsetszero];
}
if ([Self.mytableview respondstoselector: @selector (setlayoutmargins:)]) {
[Self.mytableview Setlayoutmargins:uiedgeinsetszero];
}
And then implement the proxy method of 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];
}
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
To modify the right shift of the TableView line after iOS8