Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to do this simple thing with XCode's new Auto Layout feature?
    text
    copied!<p>Im trying to do something that seems like it should be a no-brainer. But alas, im too dumb to figure this one out. So i need help.</p> <p>I have an iphone simulator (with a vertical orientation). The main view has a subview (a blue UIView) that should be displayed in the bottom 25% of the screen. The final rendered screen would basically look like a white screen with the bottom section being blue.</p> <p>I want the edges of the subview to hug the screen edge. But thats not the part I'm struggling with. The tricky thing is configuring the height of this subview (and the layout of its contents, if any) when I suddenly rotate the orientation of the simulator. If i do this, then everything looks odd.</p> <p>I would also like to note that what I see in the Interface Builder (with Auto Layout enabled) looks nothing like the app when it loads in the simulator.</p> <p>PS - for now i will keep playing around with this. maybe i will eventually reach a eureka moment.</p> <p><strong>* Updated with screen shots *</strong></p> <p>This is what my layout looks like in Interface Builder: <img src="https://i.stack.imgur.com/I23g0.png" alt="This is what my layout looks like in Interface Builder:"></p> <p>And this is what it ends up looking like in the simulator: <img src="https://i.stack.imgur.com/QfZJW.png" alt="And this is what it ends up looking like in the simulator:"></p> <p><strong>* Update 2 *</strong> Ok. After updating my post with the screenshots, it dawned on me that the simulator doesn't look like the 4" screen version (even though it does on my computer screen). After running the 4" simulator i can see the the layout just like the IB layout. But this makes me wonder why auto-layout wasn't "smart" enough to adjust for the smaller 3.5" screen.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload