I've been working on a Landscape only iPad app (which is allowed if you support both right and left landscape modes). The views are properly set-up, but the status bar is buggy. The iPad's status bar auto-rotates on it's own, and I couldn't find anything that can override it. The status bar supports all orientations regardless of what is found in the info.plist (Supported orientations and initial orientation).
I have found a workaround, by running a timer in the UIApplicationDelegate and forcing the orientation on the status bar every time, but that's j开发者_如何学Goust ugly and 'causes the bar to be jumpy.
Any way to lock the iPad's status bar to support only landscape (right and left)?
Thanks in advance, ~ Natanavra.
Some of your code would help, but this is what I usually use in my ViewController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
Which locks to landscape (both sides). I've never had any problems with the Status Bar, but I usually hide it.
Also, on the .plist I only have 2 supported interface orientations: item0 = Landscape (Right home button) item1 = Landscape (Left home button)
Hope this helps :)
精彩评论