登录视图和按钮单击显示选项卡控制器?怎么样?

时间:2013-10-20 12:32:25

标签: ios

enter image description here

我如何做到这一点:

If i press the "Einloggen" (Login) button
{
    Show TabBarController with FirstViewController
}

(我是新手,我试图找出一些有关... https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html Open another view when button is pressed in iOS

我的脚本/功能如下。

- (IBAction)loginAction:(UIButton *)sender {
    self.view = self.tabBarController.view;
}

然后我有一个黑屏。 如果我使用上面的stackoverflow问题中的代码,我会收到错误。

- (IBAction)loginAction:(UIButton *)sender {
    UIViewController* tabViewController = [[UIViewController alloc] initWithNibName:@"tabViewController" bundle:[NSBundle mainBundle]];
    [self.view addSubview:tabViewController.view];
}

提前谢谢!

0 个答案:

没有答案