0
我創建了一個非常簡單的應用程序,並以UINavigationController作爲根控制器,但是當我運行它時,只顯示導航欄的一半(左側)。爲什麼是這樣?這看起來很奇怪 - 如果我做了錯誤的事情,你會認爲它根本不會顯示,而是恰好一半!只有一半導航欄正在顯示UINavigationController
控制器看起來像這樣:
@interface RootController : UINavigationController { UIWebView* webView; NSMutableString *htmlString; }
與對應@property聲明和@synthesize。
我沒有使用任何.nibs視圖控制器/視圖。該應用程序的委託是:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RootController* theRVC = [[RootController alloc] init]; self.window.rootViewController = theRVC; [theRVC release]; [self.window makeKeyAndVisible]; return YES; }
而且控制器具有以下相關代碼:
- (void)loadView { webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.view = webView; [webView release]; } - (void)viewDidLoad { [super viewDidLoad]; }
謝謝。從UINavigationController派生出來總是不正確的嗎? – Gruntcakes
很少需要從UINavigationController派生。如果你願意,這將是定製導航控制器本身的某個方面,而不是定義內容視圖控制器。 –