Reputation: 10012
So I have some strange margins to the left and right of my app:
Here is one xib:
And here's another xib from the same app:
And here's the corresponding views from XCode (6.1.1):
and
Does anyone have any thoughts about how I might fix this? I suspect my UINavigationController is misconfigured?
I tried view.layoutMargins = UIEdgeInsetsZero
to no avail...
Upvotes: 0
Views: 1135
Reputation: 3199
There are 3 ways to set constraints without margin:
1) from the pin panel - uncheck the option 'constraint to margin':
2) After you set the constraint, select the constraint and go to the size inspector, uncheck the option 'Relative to margin' :
3) With ctrl drag - press alt (option) to toggle between the options without margin:
Upvotes: 4
Reputation: 3358
try using this in view did load
self.edgesForExtendedLayout = UIRectEdgeNone;
and in case of auto layout constraint
1) select the view and the main view and give them equal width. 2) make the table view horizontally center in superview. 3) top and bottom whatever you want.
i think this will solve your problem.
Upvotes: 2