2

I am trying to implement a custom tabbarcontroller using a UIViewController and a UITabBar. Everything is working fine so far, except when I rotate the device to landscape, the UIViewController shifts the entire view down 20pixels, creating a black bar between the status bar and the view. Even when the view is rotated back to portrait orientation, the view is still shifted down 20pixels.

What do I need to do to remove the black bar? Do I have to perform custom rotations? If so, where should I insert these rotations?

Before rotation: enter image description here

After rotation: enter image description here

futureelite7
  • 11,462
  • 10
  • 53
  • 87
  • possible duplicate of [UITabBar appears 20 pixels down?](http://stackoverflow.com/questions/5699404/uitabbar-appears-20-pixels-down), [Why do navigation appear 20 pixels below status bar in the view?](http://stackoverflow.com/questions/5850705/), [Why is my UITabBar shifting down 20 pixels when loaded on portrait?](http://stackoverflow.com/questions/4997253/) [Launch Image off by 20 pixels](http://stackoverflow.com/questions/5112697/), among [others](http://stackoverflow.com/search?page=2&tab=relevance&q=landscape%20shift%2020%20pixels). – jscs Jun 03 '11 at 18:11

2 Answers2

3

I've experienced this same issue.

This discussion was helpful: UIWebView on iPad size

Tony's answer helped me discover that when you create a subview it's helpful to setup code similar to this:

UIWebView *webView = [[UIWebView alloc] init];
webView.frame = self.view.bounds;

If you post some of your code I may be able to provide more specific advice.

Community
  • 1
  • 1
Matt
  • 693
  • 9
  • 16
0

Rather than shifting all views down, try DELTA properties in Interface builder.

enter image description here

Adeesh Jain
  • 645
  • 10
  • 22