2013-03-24 79 views
0

我有一个小问题。我有Xcode的iOS应用程序,当我启动它时,它附带从ViewController切换到TabBarController

TabBarController。但后来,我需要去到另一个视图控制器(会有与图片有些

信息),并在这之后,我需要回去与TabbarController主网页,但

当我点击返回按钮,它显示没有的TabBar在底部...为了更清晰,我做了一个计划......

Click to this link to show image scheme

任何人都可以解决售后服务这个吗?我工作没有故事板,所以我需要它

以编程方式。谢谢你的回复!

Steve 

回答

0

我的猜测是你的window.rootViewController实际上是你的UINavigationController。如果你想让TabBar出现在所有的屏幕上,那么你需要将它设置为你的window.rootViewController。

+0

thx回复,但它不是我所需要的...我将再次解释它。 我有一个视图控制器(称为ViewControlllerMAIN)和第二个NavigationController(称为RootViewController)。在AppDelgate中,我将它们拆分为一个“tbc”TabBarController,并且一切都很好,但是我需要为usnig应用程序添加一些“提示”,并且我想用ViewControllerMAIN中的按钮启动它。当我这样做,它的工作,但是,当我想回到ViewContollerMAIN(我使用它模式切换)Tabbar消失...所以是任何可能性,我该怎么做?谢谢! :-) – stepik21 2013-03-25 20:14:27

0

设置它在你的应用程序代理:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    // Override point for customization after application launch. 
    self.window.backgroundColor = [UIColor whiteColor]; 
    [self.window makeKeyAndVisible]; 

    [[NSBundle mainBundle] loadNibNamed:@"TabBarController" owner:self options:nil]; 

    self.window.rootViewController = tbc; 

    return YES; 
} 

与tabcontroller创建厦门国际银行,下降标签栏里面的导航控制器。 设置Viewcontroller的类和笔尖名称。

里面的按钮的方法,需要像:

- (IBAction)go:(id)sender 
{ 
    Primeiro2ViewController *p2vc = [[Primeiro2ViewController alloc] initWithNibName:@"Primeiro2ViewController" bundle:nil]; 
    p2vc.title = @"Primeiro 2"; 
    [self.navigationController pushViewController:p2vc animated:YES]; 

    self.navigationController.navigationBar.tintColor = [UIColor greenColor]; 
} 

如果你需要一个样品,我后来上传你。

相关问题