iPhone/iPad device orientation problems
iPhone/iPad device orientation problems
- Subject: iPhone/iPad device orientation problems
- From: William Squires <email@hidden>
- Date: Wed, 13 Oct 2010 21:16:38 -0500
Hi
What's the proper way to force an iOS device to set the
orientation to one of
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
?
The (relatively new) Wrox book says to do something along the lines of
[[UIDevice currentDevice] setOrientation:<one of the orientation
constants above>];
but both the documentation and the compiler say no. The documentation
states that 'orientation' is a readonly property of the UIDevice
class, and the compiler confirms this with a warning that "UIDevice
may not respond to 'setOrientation:'"
I know you can set the initial orientation in the viewDidLoad method,
but that technique doesn't quite work anywhere else - it'll set the
orientation all right, but the view itself won't act as if that's the
orientation in use... at least on the iPad simulator; haven't tried
uploading it to my iPad yet.
So what is the correct way of programmatically setting the interface
orientation in iOS devices?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden