Solve the UITableView split line distance from the left side of the way, the need for friends can refer to the next.
When we use TableView, we find that the left side of the split line is shorter and can usually be solved using Setseparatorinset:uiedgeinsetszero. But after upgrading to XCode6, the iOS8 found no effect. Here are the solutions:
First, add the following code to the Viewdidload method:
if ([Self.tableview respondstoselector: @selector (setseparatorinset:)]) {
[Self.tableview Setseparatorinset:uiedgeinsetszero];
}
if ([Self.tableview respondstoselector: @selector (setlayoutmargins:)]) {
[Self.tableview Setlayoutmargins:uiedgeinsetszero];
}
Then add the following code to the Willdisplaycell method:
-(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];
}
if ([Cell respondstoselector: @selector (setpreservessuperviewlayoutmargins:)]) {
[Cell Setpreservessuperviewlayoutmargins:no];
}
}
This will show up normally.
About the problem of UITableView split line distance to the left 15px solution