2

The view controller on the left has 2 containers. The top one embeds the view controller on the right. As you can see, the VC on the right has been automatically sized by Xcode to fit in the top container of the left-hand-side VC. So you would expect that the text box on the right would display just fine when you run the simulator.

However, when I run the simulator, with the text box in its current position, it is 1/2 cut off by the bottom container of the left-hand-side VC. And if the text box were any lower, it would be completely hidden.

Why is the sizing not working out? (The root VC is sized for 4", all others are inferred, and the simulator is running 4".)

visual

visual

EDIT:

I found that if I uncheck "Use Autolayout" on the storyboard file inspector, my stuff displays properly.

What are the drawback of unchecking "Use Autolayout"?

And why does Autolayout cause this bug? Thank you.

Community
  • 1
  • 1
mkc842
  • 2,361
  • 2
  • 26
  • 38
  • 1
    Auto Layout causes this because you didn't set up the Auto Layout rules correctly. The downside of not using Auto Layout is, well, your app does not use Auto Layout. If you can get the behaviour you want without using Auto Layout (and using autoresizing masks) it's totally okay to not use it. Related: [What is Auto Layout?](http://stackoverflow.com/questions/12424248/what-is-auto-layout) – Matthias Bauch Jun 17 '13 at 16:23
  • Okay, thanks. I'm learning as I go and haven't gotten to reading about auto layout. Guess it's time. Thanks for the link. – mkc842 Jun 17 '13 at 16:28
  • 1
    Auto layout is a major pain in the ass, but it's very powerful. It has a steep learning curve but can do things springs and struts can't. It will frustrate you. It will make you want to pull your hair out. Is it worth it? Who can say. It's by no means a good layout mechanism compared to hierarchical definition imo, and it's utter overkill for what Apple intends it for, but it is the direction everything is moving in, so you should probably learn it. – devios1 Apr 20 '15 at 19:17

0 Answers0