简体   繁体   English

如何从UI视图控制器显示选项卡栏控制器

[英]How to present a Tab Bar Controller from a UI View Controller

This is the situation... 就是这种情况

I have UIViewController, I want to programatically, without any buttons, to go to my Tab Bar Controller or to one of my Table View Controllers. 我有UIViewController,我想以编程方式(没有任何按钮)转到我的“标签栏”控制器或“表视图控制器”之一。

This is what I did so far: 这是我到目前为止所做的:

UIViewController.m UIViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];


        [self dismissViewControllerAnimated:NO completion:^{
        [self performSegueWithIdentifier:@"appLaunched" sender:self];}];
}

This does not work, I made a segue and gave it an id, but the issue remains, my app when launches just shows a white screen and the transition is never made. 这是行不通的,我做了一个segue并给了它一个id,但是问题仍然存在,我的应用在启动时仅显示白屏,并且从未进行过过渡。 Can anyone help me please? 谁能帮我吗?

Thank you. 谢谢。

Perhaps try something like 也许尝试像

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self pushIt];
}

- (void)pushIt
{
    [self.navigationController pushViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"appLaunched"] animated:YES];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM