Wednesday, 21 August 2013

Auto Layout view resizing frustrations when designing in Interface Builder

Auto Layout view resizing frustrations when designing in Interface Builder

Problem: UIView size is "locked" when designing with Auto Layout in IB
I've uploaded a 20 second video that illustrates my problem, but let me
describe it. You may recognize the project: it's right out of Apple's WWDC
2012 "Introduction to Auto Layout." I've got a simple iPhone view in
Interface Builder where I've already got a button and label along the
bottom. The next step is to add a UIView. Here's where things get ugly.
When I drag the UIView out of the palette in Interface Builder and onto
the iPhone window, as soon as I let it go it seems to become locked in to
its starting size. I place it in the upper left corner, and I'd like to
drag it horizontally to the right side of the window, and vertically to
where it will be up against (minus the padding) the button and label along
the bottom. But, when I try to resize it, I cannot. It's stuck on its
original size!
The video illustrating my problem is here:
http://www.youtube.com/watch?v=jsW4UwnCEkw
You can see me grab the right edge of the view and try to pull it along to
the right side of the window, but it won't expand. You can then see me
move the entire view to the right side (it retains its size) and then try
the opposite: grabbing the left side and trying to expand it so that it
sizes up against the left side of the window. In both cases, the view is
simply locked to its original size.
What gives! Auto Layout in Interface Builder is just the most frustrating
thing. How do I resize a view by dragging? Thanks!
(Note: Xcode 4.6.3.)

No comments:

Post a Comment