View offset by navigation bar
I have a place profile set up that displays place information in a nib. When I push this view in the standard screen flow it works fine. However when I push this view from another tab the UINavigationBar seems to offset it please see image here - http://imageshack.us/photo/my-images/525/screenshot20111006at225.png/ I th开发者_Python百科ink it may be the navigation bar going over the view however I'm not sure how to correct this.
- In Interface Builder, make sure the view is autosizing and you've turned on the Navigation Bar in "Simulated Metrics", so that the top Y coordinate is 44 as opposed to zero. Oh, and make sure your navigation bar isn't set to Black Translucent, but Black Opaque.
To manually correct, set
self.view.boundsto the right co-ordinates in your featured view'sviewWillAppearorviewDidLoad(if you use manual coordinates,viewDidLoadis fine, but I think you needviewWillAppearif you're using parts ofself.navigationControllerlike the position ofnavigationBar). For example:- (void) viewDidLoad { [super viewDidLoad]; self.view.bounds = CGRectMake(0, 44, 320, 367); // assuming tabbar+navbar }
加载中,请稍侯......
精彩评论