开发者

View controller is drawing under my navigation bar after popping ttthumbsviewcontroller

I'm implementing the TTThumbsViewController from the Three20 project and things are finally starting to take shape. I push the TTThumbsViewController from the current view controller by just pushing it onto开发者_JS百科 the current stack and animate the transition (common navigation controller push).

My problem is that when I pop the TThumbsViewController view controller, the navigation controller is stuck in a mode where its view controllers are drawn UNDER the navigation bar (which is now translucent).

Start

View controller is drawing under my navigation bar after popping ttthumbsviewcontroller

Push

View controller is drawing under my navigation bar after popping ttthumbsviewcontroller

Pop

View controller is drawing under my navigation bar after popping ttthumbsviewcontroller


You need to reconfigure the original style of the status bar, navigation bar & tool bar when your view reappears. You can do this by implementing viewWillAppear: in your view controller:

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:animated];

  UINavigationController* navController = self.navigationController;
  navController.navigationBar.barStyle = UIBarStyleDefault;
  navController.navigationBar.tintColor = [UIColor redColor];
  navController.toolbar.tintColor = [UIColor redColor];

  [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
}


It looks like the view controller you are pushing from does not inherit from TTViewController. You may also need to set the 'navigationBarTintColor' property back to your original color after the view has been popped off the stack; if you have not set a global stylesheet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜