0

我有一個三個標籤欄第一個標籤欄有一個表視圖..works罰款和第二個標籤欄有一個UIviewController其中包含三個按鈕..如果我要點擊任何一個按鈕,它導航到另一個視圖。在我的按鈕s(IBACtion)..我編碼[[自導航控制器] pushViewController:newEnterNameController1動畫:是];按鈕的IBaction不起作用。 我的猜測是在應用程序委託類...我應該添加導航控制器作爲我的子視圖,但這樣做會使我的標籤欄不可見....是否有任何方式添加導航控制器作爲我的窗口子視圖....或任何其他方法,以顯示我的UIView,tableview中和標籤欄的iPhone應用程序tabbar containg導航和基於視圖的應用程序

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    [self.window addSubview:tabBarController.view]; 
    [self.window makeKeyAndVisible]; 

    return YES; 
} 

回答

1

訣竅是添加你NavigationController到控制器的tabBarController的陣列添加tabBarController到主窗口前。 例如:

NSArray *controllers = [NSArray arrayWithObjects:yourNavController, someOtherController, nil]; 
tabBarController.viewControllers = controllers; 
[self.window addSubview:tabBarController.view]; 
+0

thanks ... dat working – kingston 2011-04-25 09:24:34

相關問題