tags:

views:

24

answers:

1

(In the application start up event, I added my main view to app's Window in the following codes:

- (BOOL)application:(UIApplication *)application 
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  // Override point for customization after application launch.
  MyViewController* vc = [[MyViewController alloc] 
                initWithNibName:@"MyViewController_iPhone"
                bundle:nil];
  [window addSubview:[vc view]];
  [vc release];
  [window makeKeyAndVisible];
  return YES;
}

In my MainWindow.xib, there is no view there. It is just an empty window. MyViewController contains a navigation bar and a table. In IB, both main and my view controller has status bar at the top and my view is filled to its max view.

The issue I have is that half of my navigation bar is covered by status bar (in simulator):

alt text

I could adjust my view navigation bar lower a bit, but I don't think that's the right way to do it. Not sure if there is any way in IB or in codes to let the added view to Window is filled with the consideration of status bar?

By the way, I am using XCode 3.2.4 and iPhone 3.2 for my app.

A: 

Are you animating in the status bar? Chances are, the view is created before the status bar is unhidden, so the view's frame is setup showing full screen. Later, when the status bar is animated in, the view is not automatically resized.

coneybeare
I am not sure if I can animate status bar to display. The codes I posted in my question is the start up of my app, where I add my view controller. All the UIs I have in my view are added from IB. I don't have any codes to create UIs such as navigation bar or table view. May be I should add my view from another app event?
David.Chu.ca