1, remove the redundant dividing line of UITableView blank
Self.myTableview.tableFooterView = [[UIView alloc] Initwithframe:cgrectzero];
2, set the location of the split line
Method One:
Add the following code on the Willdisplaycell
-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: ( Nsindexpath *) indexpath{ = Uiedgeinsetsmake (000); // Uiedgeinsetsmake (cgfloat top, cgfloat left, CGFloat bottom, cgfloat right) // Indent 50pt
If you want to go to the last row of cell split line need this
-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: ( Nsindexpath *) indexpath{ if (indexpath.row==datasourcearray.count-1) { = Uiedgeinsetsmake (000); }
Method Two:
-(void) viewdidlayoutsubviews{if([Self.tableview respondstoselector: @selector (setseparatorinset:)]) {[Self.tableview Setseparatorinset:uiedge Insetsmake (0, -,0,0)]; } if([Self.tableview respondstoselector: @selector (setlayoutmargins:)]) {[Self.tableview Setlayoutmargins:uiedgein Setsmake (0, -,0,0)]; }}-(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]; }}
As follows:
UITableView Setting the cell's separator split line