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

相关问题