Changing Interface Builder Orientation in Xcode 4

So, after a couple months of resisting, I finally decided to update to Xcode 4. (Both for the new iOS 5 stuff, and for GIT support [which I need for some new projects]).

It’s actually a fairly nice update to Xcode, with lots of nifty new things that make life easier, but one thing that drove me crazy was how difficult it was to discover how to rotate my iPad layout in Interface Builder from Portrait to Landscape. So, in an effort to save you some time, here’s how you do it:

* Open your layout file.

* Select the view you want to rotate. This will give it a green highlight.

* Click the green highlighted border. It should turn blue.  (This can be tricky. You may have to drag across it to select it properly.)

* Open the Utilities menu, and click the “View” Icon. (It’s 3rd from the right. For some reason, it looks like a shield. Go figure.)

* At this point, you should see a list of iPad/iPhone Simulated Metrics. One of those is “Orientation”. Pick “Landscape” from this menu and you’ll be done. (Note that you will only see these metrics if the view is properly selected and has a blue border. If not, you’ll see the normal view options, which do NOT have any orientation controls in them.)

The attached photo shows a slice from the Xcode 4 window that has the correct setup.

Where to find the settings for Landscape views in Xcode 4

About these ads
This entry was posted in Apps, iPad, iPhone, Xcode. Bookmark the permalink.

7 Responses to Changing Interface Builder Orientation in Xcode 4

  1. aarontcan says:

    How did it allow you to change the orientation? My Xcode doesn’t let me change it from “portrait” to “landscape.”

    • egosystems says:

      Not sure what to tell you… if you are using Xcode 4, and you follow the steps in the article, you should be able to make the change.

    • citroid says:

      I had the same problem at first, having the orientation drop down grayed out. Be sure to select the DetailView.xib (and not MainWindow.xib) and then you can change the view to landscape.

  2. ryanmitchellgames says:

    Is it possible you have “inherit all properties” or a “lock” on there?..

  3. neil says:

    Hi, thanks for the hint. Maybe you have also figured out how to zoom out the view? It is totally annoying to pan back and forth while designing for the iPad…

    • egosystems says:

      As near as I can tell, there isn’t a way to zoom in or out in the current versions of Interface Builder. I do know that several folks have submitted bug reports/feature requests for this though, so, hopefully, it’s something that will be added soon.

  4. andy says:

    Thanks, Elena! By the way, the icon that “looks like a shield” is supposed to look like a slider bar (the shield is the pointer)! Dunno what the squiggly(≈) “quick help” is tho’; lines of text on a page?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s