Fix iPad status bar orientation as portrait - iphone

I have an iPad application with a simple tab bar. I need to fix the orientation as portrait. I do that by setting "Portrait (bottom home button)" in the "Supported interface orientation" field in the plist file.
The problem is that the status bar still move when rotating the iPad... how can I fix it ??
Thanks for reading.

Remove the default implementation of shouldAutorotateToInterfaceOrientation: from all your view controllers.

Related

iOS StoryBoard with some Portrait views and some Landscape

I have a story board based iPhone application where the majority of the views are in Portrait mode, and should only ever be shown in portrait, due to the nature of the content. But then I have one view which should only ever be in landscape - how can I ensure that views are only displayed in the correct orientation?
I tried adding a second storyboard with the main storyboard set to Portrait orientation and the new storyboard set to landscape but if you launch the landscape view it appears in portrait mode. Can I forcibly rotate the view to landscape in viewWillAppear?
I tried setting the Target's build setting, orientation value to 'Portrait' and 'Landscape Left' but now been my portrait-only storyboard will auto rotate and screw up it's layout.
So, basically, how can I force a view to allow only one particular orientation (portrait for most of view, landscape for just one)?
Only one storyboard will do this. You need to do that ..
1- Go to inspector and select the view and then uncheck the autolayout.
2- Then click on size inspector top right on xcode file.
3- select your controlls one by one and resize them from Left,Right,Top and Bottom.
4- After that run your project.and see what happen....

iOS cannot make UIWindow landscape in Interface Builder

I am trying to set a UIWindow in MainWindow.xib into landscape mode. Unfortunately, this option is greyed out in Interface Builder. I have a Navigation Controller within the same NIB that can be set to landscape, but this ends up looking awkward in Interface Builder, as the Nav Controller is set to landscape but the containing window is in portrait.
What's worse is that I can't get the window to run in landscape during runtime. I have this code in the view within the nav controller:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
I don't know how to specify this for the containing window though. I have set the orientation in the plist but this doesn't seem to make my view display in landscape.
From what i can see, it seems like you want your first view controller to be in landscape mode, when displayed.
For this, you need to set the "Initial orientation" in your info.plist file. There is a key for this.
Thus, what you need to do is, Make your xib in landscape mode, implement the method as you have done above and set the initial orientation to landscape in plist.
I faced a problem with the UIWindow being forced into portrait mode as well. My solution was to use another view level between the window and the views I was manipulating. Though not a perfect solution it worked. I hope you get it worked out.

Tab bar controller in landscape mode

All my app is in landscape mode .In some point I switch to a screen with Tab Bar Controller , but it's been placed like in portrait mode.I subclassed the UITabBarController and override the method "shouldAutorotateToInterfaceOrientation" to return YES always but because the app is already in landscape , this method is not being called.
does anyway have an answer to this?
thanks
Giald
You shouldn't have to subclass UITabBarController. The tab bar will autorotate to landscape, if all it's subviews support landscape. Just make sure all tabs support landscape orientation and you should be fine afaik.
Rengers is right, just make sure all tab views have YES in their respective shouldAutoRotateToInterfaceOrientation overrides. Depending on how you setup your app, check if any parent views have the shouldAutoRotateToInterfaceOrientation overrides. If so, it might be worthwhile commenting them out and leaving the overrides for the tab views only.

Is it possible for navigation based application to switch to any other orientation mode?

My application is completely navigation based and my query is that navigation based application can switch to any mode i mean orientation to portrait to landscape.
Please help me out
Thanks in advance
The navigation controller automatically works in any orientation. Once you rotate your views, the navigation controller rotates with them.

How to make a UINavigationBar "thin"?

In certain places such as Mail.app, the top navigation bar is thinner in landscape mode than in portrait mode. Does anyone know how I could get something like this in my own app?
This is the default behavior. What makes you think you're not getting this in your own app? You just need to override
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
in your view controller and return YES in all cases. The navigation bar (assuming you're using a UINavigationController) at the top will be thinner in landscape than in portrait by default.