O'Reilly logo

Xcode 4 iOS Development by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – repositioning the Controls

In the previous section, we looked at how to change the orientation of our view using the iPhone Simulator and also observed that the size and positioning of the controls remained. This is not a desirable way to do things in the real-world, as this does not give the user a good experience while using your application. Ideally, you should reposition your controls on the screen so that they change according to the view orientation that the phone is currently in.

In order to reposition the controls within our view, let's go back to our previous example in Interface Builder and follow these steps:

  1. Select the Label control; select View | Utilities | Size.
  2. Modify the Autosizing attribute of the control as shown ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required