开发者

Push UITabViewController from UIViewController is possible?

my app first viewController is UIViewController. and when user click button firstView disappear and push UITabViewController is it possible?

i can't find how to push UITab开发者_StackOverflowViewController from UIViewController.


UPDATE sorry, I misread TabVC for UITableViewController. Do you mean UITableViewController or UITabBarController? I'll leave my answer below anyways.

In this instance, it's usually best to have a UITabBarController be the root view object. Although it can be done, it's a messier implementation, in my opinion. I would in fact make the UITabBarController the root and display the UIViewController modally from that UITabBarController on launch.

The user would be presented with the UIViewController and when they clicked the button, dismiss that modal view, revealing the UITabBarController.


Just use a UINavigationController. Use the navigation controller to push the tableView as the second level in the hierarchy. As a bonus you'll get the back button for 'free' and you don't have to worry about delegates for getting back to the original UIViewController.


you may try this:

self.tabBarController.selectedViewController
= [self.tabBarController.viewControllers objectAtIndex:2];

it should work because selectedViewController property contains view of selected tab.


First of all you have view controller . And make Second view controller which contain tabbarcontroller . Now just push second view controller . And add tabbarcontroller's view as a subview to second view controller .

Hope you gets it ..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜