iOS 9 UITableView separators insets (significant left margin)
Okay, I have found out the solution. The only thing required for that is to set on the presenting instance of UITableView
that flag cellLayoutMarginsFollowReadableWidth
myTableView.cellLayoutMarginsFollowReadableWidth = NO;
I wanted to find some reference in the documentation but it looks like it is not ready yet, only mentioned on diff page.
As the flag was introduced in iOS 9 for the backward compatibility you should add a check before trying to set it:
if([myTableView respondsToSelector:@selector(setCellLayoutMarginsFollowReadableWidth:)])
{
myTableView.cellLayoutMarginsFollowReadableWidth = NO;
}
For Swift 2.0
you can use #available
to check iOS version.
if #available(iOS 9, *) {
myTableView.cellLayoutMarginsFollowReadableWidth = false
}
Moreover you need to compile it with Xcode 7
or above.
EDIT
Please keep in mind that this is the only required fix if your separators looked "fine" up to iOS 8, otherwise you need to change a bit more. You can find info how to do this already on SO.
UITableViewCell separator insets don't work when table.width is much greater than view.width
There are two ways in which you can solve this problem.
First one you can add a separator line view in cell content view.
UIView* line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableview.frame.size.width, 3)];
line.backgroundColor = [UIColor whiteColor];
[cell.contentView addSubview:line];
The second one is apple provided one and pretty easy also just add this line of code where u declare your tableview
yourTableView.cellLayoutMarginsFollowReadableWidth = NO;
xcode 7 / iOS 9 / iPhone 6 sim: why extra padding to left of UITableView?
There is a small left-margin before each horizontal bar between the UITableViewCell
s in the UITableView
. Looking at the prototype cell for a UITableViewCell
in one of my storyboards, I believe this left-margin is baked into the cell by default. I do not know if it is adjustable.
UITableview separator not hiding for iOS9
Please set the separator style to None in layoutSubviews method.
When constraints-based layout is used the base implementation applies the constraints-based layout and setting separatorStyle to UITableViewCellSeparatorStyleNone in this method will hide the separator for you.
Related Topics
Firebase Limit on the Number of Observers/Listeners
Create and Perform Segue Without Storyboards
Creating Thumbnail from Local Video in Swift
Xcode Debugger Doesn't Print Objects and Shows Nil, When They Aren'T
How to Convert an Int to a Character in Swift
Uitableview Auto Resizing Row Constraint Breaking Mysteriously on iPhone 6Plus
Mkmapview Show Incorrectly Saved Region
Are View Controllers with Nib Files Broken in iOS 8 Beta 5
Sending a Private Message to Your Friends via Facebook iOS Sdk
Parse Multipart Response for Image Download in iOS
How to Save List of Object in User Default
How to Force an App to Change Language in iOS/Objective-C
How to Get the Incoming Call Number by Using Callkit
Using Mdm to Configure an Enterprise App via Nsuserdefaults
Why Is There an Frame Rectangle and an Bounds Rectangle in an Uiview