2

I in my AppDelegate, I use:

    ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]];

    UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController];

    [self.tabBarController setSelectedIndex:0];     
    [self.tabBarController setSelectedViewController:acNavController];

To switch the views in my TabBarController. The result is to close to the window top:

alt text http://img.skitch.com/20090718-tpgya2nt4yeadacgs54dh8syp2.png

How do I get my view to correct position?

Regards

Stefan
  • 28,843
  • 15
  • 64
  • 76

4 Answers4

10

Here is the real answer. The dot before (void) is actually a dash.

- (void)viewWillAppear:(BOOL)animated {
    // to fix the controller showing under the status bar
    self.view.frame = [[UIScreen mainScreen] applicationFrame];
}
BastiBen
  • 19,679
  • 11
  • 56
  • 86
Aakburns
  • 307
  • 1
  • 5
  • 19
1

check how the size of the view is defined either in interface builder or in your code. Make sure it accounts for the 20 pixels allocated to the status bar, that is the height should be no more than 460.

ennuikiller
  • 46,381
  • 14
  • 112
  • 137
1

In Interface Builder, make sure "Status Bar" is not set to "None" under "Simulated Interface Elements" in the view's attributes.

Can Berk Güder
  • 109,922
  • 25
  • 130
  • 137
0

The solution was to load the UIViewController in the old UINavigationViewController. This way the UIViewController keeps its former position. Thanks for your help

Stefan
  • 28,843
  • 15
  • 64
  • 76