2011-12-02 78 views
0

我在一個視圖基於應用程序在iPhone的工作,我想表明,當它被裝載的導航欄,我在viewDidLoad中功能使用[self.navigationController setNavigationBarHidden:NO animated:YES];,但仍呈現不一樣簡單視圖導航欄上方,有什麼問題導航欄查看基於應用

+1

你在你的項目中的導航控制器? – Vin

+0

我使用視圖基於應用程序,默認情況下,現在,我只加了上面的代碼,現在基於 –

+0

web應用程序?你的意思是你的應用程序是由Safari瀏覽器訪問,或你有你的觀點一個一個UIWebView。無論如何,你需要有一個UINavigationController來顯示導航欄。備用解決方案是在您的視圖上放置來自IB的導航欄。 – Vin

回答

1

self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; 

    UINavigationController *navcontrol = [[UINavigationController alloc] initWithRootViewController:self.viewController]; 

    self.window.rootViewController = navcontrol; 
0

您需要的NavigationBar添加到您的視圖。 調用此,如果您使用Xcode4然後爲此在應用程序委託應該整理出來

[self.view addSubview:navigationController.view];