【发布时间】:2012-02-16 15:08:14
【问题描述】:
我是 iPhone 开发的新手,但我得到了一个 iPhone 应用程序要调试,我不知道从哪里开始。
问题如下:
该应用有一个顶部有导航栏的视图。当我按下设备上的主页按钮时,我想应用程序会进入暂停模式。当我从列表返回应用程序时,我可以看到视图但没有导航栏。为什么导航栏会消失,我该如何解决?
这是相同的代码
-(void)viewWillAppear:(BOOL)animated
{
[self prepareNavBar];
}
-(void)prepareNavBar
{
self.navigationItem.hidesBackButton = NO;
CustomNavBar *the_pNavBar = [[CustomNavBar alloc] init];
[the_pNavBar prepareNavbarWithLeftButtonImage:nil leftButtonAction:nil titleImage: [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_heading_comments.png"]] rightButtonImage:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_submit.png"]] rightAction:@selector(postComment) target:self backgroundImage:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_background_grey_150px.png"]] navigationBar:self.navigationController.navigationBar isStandardNavBar:NO];
[the_pNavBar release];
}
如果需要任何其他代码,请告诉我
【问题讨论】:
-
如果你添加一些代码会容易得多。
-
显示设置导航控制器和添加其根视图控制器的代码。识别它所在的文件。
标签: iphone ios debugging uinavigationcontroller