导航后获取 tabbarcontroller
我有一个带有按钮的视图控制器,单击该按钮后应该会出现 tabbarcontroller。如何以编程方式执行此操作。?
我发现的所有教程在应用程序启动后立即显示选项卡栏。但我希望它在单击按钮并导航到另一个视图后可见。
我编写了用于导航到新页面的代码,以便新页面应包含选项卡栏控制器。
-(IBAction)buttonClicked
{
ViewController *viewController = [[ViewController alloc]initWithNibName:@"view" bundle:nil];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
I have a view controller with a button and after clicking that button tabbarcontroller should appear.how to do it programatically.?
all the tutorials i found show tab bar immediately once the app is started.but i want it to be visible after the button is clicked and navigated to the other view.
i wrote code for navigating to a new page so that new page should consist of tab bar controller.
-(IBAction)buttonClicked
{
ViewController *viewController = [[ViewController alloc]initWithNibName:@"view" bundle:nil];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样的事情:
Try something like this:
从“单一空视图”项目开始。
然后只需添加一个新的
UITabBarController
(在我的脑海中)然后你必须在
tabBarItem
属性中的相应 viewController 中设置标题和图标: http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/tabBarItemStart of with a 'single empty view' project.
Then just add a new
UITabBarController
(out the top of my head)Then you have to set the title and icon in the corresponding viewControllers in the
tabBarItem
property: http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/tabBarItem