2012-02-16 103 views
-2

我對iPhone的開發很陌生,但我得到了一個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]; 

} 

代碼,請讓我知道如果任何其他代碼需要

+0

問題就好辦多瞭如果你添加一些代碼。 – Yorxxx 2012-02-16 15:13:01

+0

顯示設置導航控制器並添加其根視圖控制器的代碼。識別它所在的文件。 – Jim 2012-02-16 15:55:29

+0

根據要求添加代碼 – Nik 2012-02-16 16:25:56

回答

0

我固定由下面的代碼

-(void)didBecomeActive:(NSNotificationCenter *)in_pNotif 
{ 
    [self performSelector:@selector(test) withObject:nil afterDelay:0.01]; 
} 

-(void)test 
{ 
    self.navigationController.toolbarHidden = YES; 
}