How to remove the default padding of content view in UITableViewCell
?
I put two label in the UITableViewCell
's content view, The content view has a gray background color.
when I set top margin space between title and the content view to 0 (via constraint), the title is not align to the top!!! The same is leading and trailing space.
Here is my view struct:
I googled a lot, the answer in this post works by overriding the layoutSubviews
of UITableViewCell and setting frame of title manually.
But can I do it in story board? or it there a attribute or something that controls the padding of the content view????
There is a checkbox labeled "Constrain to margins" in the popup where you specify constraints. I suspect you left it checked. Margins default to 8 points, which may explain what you are seeing.
Here is a better answer with screenshots: https://stackoverflow.com/a/26755511/4122965
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With