gpt4 book ai didi

iphone - 标签栏+导航栏

转载 作者:行者123 更新时间:2023-12-03 20:50:03 25 4
gpt4 key购买 nike

我有一个两个选项卡栏,在第一个选项卡中,我可以向下钻取三个以上...但在第二个选项卡中我无法向下钻取多个...有什么想法吗?

代码:DemoAppdelegate.m

- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:tabBarController.view];
}

First tab controller is "FirstViewController"
in FirstViewController.m i have written to drill down to "billsummary.xib"


DemoAppDelegate *app = (DemoAppDelegate *)[[UIApplication sharedApplication] delegate];
UINavigationController *naviController = app.navigationController;
BillsSummary *aViewAController = [[BillsSummary alloc] initWithNibName:@"BillsSummary" bundle:[NSBundle mainBundle]];

[naviController pushViewController:aViewAController animated:YES];
[aViewAController release];

which is working fine.But same code for in second tab for another .xib is not working and in second tab i have not used appdelegate instead i used "self.navigationcontroller"

UINavigationController *naviController = self.navigationController;
PaymentsAmount *aViewAController = [[PaymentsAmount alloc] initWithNibName:@"PaymentsAmount" bundle:[NSBundle mainBundle]];

[naviController pushViewController:aViewAController animated:YES];
[aViewAController release];

要做什么?有什么帮助吗?

最佳答案

我不明白你的代码结构,但通常这个问题是通过以下方式解决的:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...

// Initialize UINavigationControllers and push first viewcontrollers for each one

UIViewController *view1 = [[UIViewController alloc] init];
UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:view1];
[view1 release];

// Same for the second NavigationController

...

// Initialize UITabBarController
UITabBarController tController = [[UITabBarController alloc] init];
tController.viewControllers = [NSArray arrayWithObjects:nav1, nav2, nil];
[nav1 release];
[nav2 release];

[window addSubview:tController.view];

...
}

关于iphone - 标签栏+导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1319049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com