The following two methods can be used anywhere in the. m file of the TableView controller to resolve/** * The following two methods address the problem of cell split lines not to the left boundary */-(void) viewdidlayoutsubviews { if ([ Self.tableview respondstoselector: @selector (setseparatorinset:)]) { [Self.tableview setseparatorinset: Uiedgeinsetszero]; } if ([Self.tableview respondstoselector: @selector (setlayoutmargins:)]) { [Self.tableview setlayoutmargins: Uiedgeinsetszero]; } } /** * This method and the above method solves the problem that the cell split line is not to the left boundary */-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) Cell Forrowatindexpath: (Nsindexpath *) indexpat{ if ([Cell respondstoselector: @selector (setlayoutmargins:)]) { [Cell Setlayoutmargins:uiedgeinsetszero]; } if ([Cell respondstoselector: @selector (setseparatorinset:)]) { [cell Setseparatorinset:uiedgeinsetszero];} }
Solve the problem of Tableviewcell split line not to the left boundary