标签栏 +导航栏
我有一个两个选项卡栏,在第一个选项卡中,我可以向下钻取三个以上...但在第二个选项卡中我不能向下钻取多个...有什么想法吗?
代码: 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];
该怎么办?有什么帮助吗?
I have a two tab bar,In first tab ,i can drill down more than three... but in second tab i cannot drill down more than one.. Any ideas?
code:
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];
what to do? Any help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不明白你的代码结构,但通常这个问题是通过以下方式解决的:
I didn't understand your code structure, but usually that problem is solved in the following way:
请参考这里给出的答案。那里还提供了教程链接。祝你好运。
如何:标签栏控制器中的导航控制器
Please Refer the answer given here. A tutorial link is also provided there. Best of luck.
How to : Navigation Controller in Tab Bar Controller
您的第二个代码片段位于哪个文件中?可能是
self.navigationController
没有引用您认为它引用的导航控制器。What file does your second code snippet live in? It might be that
self.navigationController
doesn't refer to the navigation controller you think it does.