I've stumbled upon a strange behaviour, where cells added to a UITableView
were sometimes indented to the left. This only happens on iOS 8.3, and I can't find a clear pattern as to when this happens.
Anyone experiencing same thing?
I've stumbled upon a strange behaviour, where cells added to a UITableView
were sometimes indented to the left. This only happens on iOS 8.3, and I can't find a clear pattern as to when this happens.
Anyone experiencing same thing?
This fixed for me. I've just stopped using
UITableViewCell
'simageView
andtextLabel
properties reconnected to my outlets.I've seen a variation of this issue with an app I'm working on. We're seeing some table view cells with incorrect leading/trailing alignment.
It's not connected to iOS 8.3, it only occurs when building with Xcode 6.3. I can take the same project and build it on Xcode 6.2 and it doesn't occur.
After some investigation, it turns out that this only occurs on the table view cells in xibs.
The workaround is to remove the leading/trailing constraint to margins and set them directly to the superview (i.e. the cell content view).
Well - this is strange...
It seems that sometimes
UITableViewCellContentView
'scontentView
is not aligned with theUITableViewCellContentView
itself. This happens when theUITableView
is in itself a part of a layout wider than the screen (as in the case of a horizontal pager).Luckily, the solution is simple: add a constraint to align the
contentView
with its parent. This can only be done programatically, as you can not edit thecontentView
's constraints in the layout editor.This only started happening on iOS 8.3, but the fix seems to be safe and backward compatible to earlier versions as well.
As always - please comment with your own experience.
Looks like it's because of layoutMargins property. I've unchecked my constraint second item "Relative to margin" and everything worked great. Here is the article.
My tableViewCells were seeing increased left and right margins when run on iOS 8.3 that I did not see on previous versions.
Setting:
fixed my problem and kept my margins consistent on all versions but be aware that this in only available on iOS 8+.
So here, for example, is where you might do this: