I am trying to get an iPhone app that requires almost every click or pop up on the Nav controller stack to change orientation.
Basically the first look is a portrait, the second is the third portrait again (yes, I know that this is less than ideal, but that the design and I have to implement it).
Here I got various tips ...
How to determine the rotation on the iPhone without autorotation of the device? Customize portrait orientation when clicking a new view on the UINavigationViewController
Is there a documented way to set iPhone orientation?
But without complete success.
The setup for linking to 3.1.2 my reading of the related articles above seems to indicate that if my portrait look pushes the view with
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
Then this view should look turned towards the landscape. What happens is that it appears in its βbrokenβ portrait form, and then rotates correctly when the device is rotated.
If I return the controller back to my portrait (which has the corresponding mustAutoRotate ...), then it will remain in the broken landscape view until the device returns to portrait orientation.
I also tried deleting all ifautorotate messages and force rotation instead by changing the view. This kind of work, and I realized that by moving the status bar (which is actually hidden in my application) [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight; , the keyboard will be displayed in the correct orientation if necessary.
The problem with this approach is that the status bar conversion is weird and ugly when you don't have a status bar - the shadow hangs over the page with every change.
So. What am I missing.
1) Am I not mistaken that in 3.1.2 (or perhaps earlier) the desired direction should be set simply by pressing the controllers?
2) Is there any other way to get the keyboard in the correct orientation.
3) Is the undocumented API a call (please, no!)
objective-c iphone uiinterfaceorientation
Andiih Apr 22 '10 at 9:29 2010-04-22 09:29
source share