Josh Kahane
Josh Kahane

Reputation: 17160

How to Handle iPad Rotation?

I have the core of an iPad app made up, its relatively simple. However I want to add support to portrait mode (currently works in landscape). Trouble is, its quite a customised, unique interface, made of different uiimages, labels, etc

So how when the user rotates the iPad, can I handle the movement of all these objects? Whats the best way to do it?

Thanks.

Upvotes: 2

Views: 532

Answers (1)

trumpetlicks
trumpetlicks

Reputation: 7065

If you have designed the interface in interface builder, you can build up the relationships between GUI elements through the interface builder, and at a first shot, see what it does with the rotation. This MAY work for you, I know there are interfaces I have designed where this is NOT an option, and others where it works just fine.

Else, You may have to write all of the positioning code yourself. Probably the Best way to do this from my experiance is to use pre-processor directives to define your positions for all of your elements in each of the 2 orientations. This way you write the routines for manipulation and then your small tweaks that you may need to make after you let it run the first time can simply be numeric tweaks in your pre-processor directives file.

http://bynomial.com/blog/?p=85

http://the.ichibod.com/kiji/how-to-handle-device-rotation-for-uiviews-in-ios/

Upvotes: 3

Related Questions