carloabelli
carloabelli

Reputation: 4349

Xcode Autoresize Subviews Not Working

I have a .xib with a UIViewController sized for the iPhone 5 (4" screen). The problem is when I go on the iPhone 4 (3.5" screen) simulator the view does not autoresize. The bottom part of the view just gets cut off. I know .storyboards autoresize so why not .xibs? How can I autoresize the view? I created a custom ViewController class which check if the phone is a 3.5" screen and then adjusts the main view accordingly, but this complains with a long warning about conflicting constraints and works for the main view, but not the subviews added to it after. Is there a better way or should I continue with what I am doing?

Upvotes: 1

Views: 3422

Answers (1)

Lukas
Lukas

Reputation: 607

You could handle the autosizing mask by yourself.

First, you have to uncheck "Use Autolayout" in the File Inspector from your xib. After you did that, you can go to the Size Inspector and play around with the autosizing mask by (de)selecting the strikes (called struts) and arrows (called springs).

Upvotes: 3

Related Questions