我有一个自定义图像标题在uinavigationbar上方。我这样做这个代码:从活动状态返回时,uinavigationbar向上移动
self.navController.view.frame = CGRectMake(0.0, 0.0, 320.0, 480.0);
self.navController.navigationBar.frame = CGRectMake(0.0, 73.0, 320.0, 44.0);
UIView *checkNav = [self.navController.view viewWithTag:9999];
if (checkNav == nil) {
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"header-logo.jpg"]];
imgView.tag = 9999;
[imgView setFrame:CGRectMake(0.0, 23.0, 320.0, 50.0)];
[self.navController.view addSubview:imgView];
}
这很好。但是,当应用程序不活动时(点击主iphone主页按钮),然后回到应用程序,uinavigationbar会移动到屏幕顶部的默认位置,并隐藏在自定义标题图像后面。
我试过把代码扔到applicationDidBecomeActive中,但它没有帮助。任何帮助将不胜感激。
谢谢!
请包括您“投掷”到applicationDidBecomeActive中的代码。 – jrturton 2011-12-29 18:11:01