Auto-scaling reduces size when planning in Interface Builder

Problem: UIView size is "locked" when designing using automatic layout in IB

I uploaded a 20 second video that illustrates my problem, but let me describe it. You can recognize the project: it is right from Apple WWDC 2012 "Introduction to Automatic Layout". I have a simple iPhone view in Interface Builder, where I already have a button and a shortcut at the bottom. The next step is to add a UIView. Here, where everything becomes ugly.

When I drag a UIView from the palette into the Interface Builder and into the iPhone window, as soon as I release it, it seems to be locked to its initial size. I put it in the upper left corner, and I would like to drag it horizontally to the right side of the window and vertically to where it will be against (minus filling) with the button and the inscription below. But, when I try to resize it, I cannot. It is stuck in its original size!

A video illustrating my problem is here:

http://www.youtube.com/watch?v=jsW4UwnCEkw

You can see me picking up the right edge of the view and trying to pull it to the right side of the window, but it will not expand. Then you can see how I move the whole view in the right direction (it retains its size), and then try to do the opposite: grabbing the left side and trying to expand it so that it depends on the left side of the window. In both cases, the view is simply locked to its original size.

What gives! The automatic layout in Interface Builder is the most annoying thing. How to resize a view by dragging and dropping? Thanks!

(Note: Xcode 4.6.3.)

+7
xcode autolayout interface-builder
source share
1 answer

In IB, in the series of buttons in the lower right corner, click the rightmost button:

rightmost button

When you do this, you will see a pop-up menu "When you resize" Apply restrictions on ... ":

When resizing Views Apply Constraints To ...

Make sure Brothers and Sisters are not checked.

+14
source share

All Articles