如何在 iPhone 的基于视图的应用程序中添加导航控制器? [英] How to add navigation controller in View Based Application in iPhone?
问题描述
我的应用程序是基于视图的应用程序.那么如何在我的应用中实现导航控制器.
My application is view based appln. So how can i implement navigation controller in my apps.
如果我使用了这个代码,我的控制器就可以正常工作.
If i have used this code, my controller works fine.
FirstClass *first = [[FirstClass alloc] initWithNibName:@"FirstClass" bundle:nil];
[self presentModalViewController:first animated:NO];
但是在我的应用中使用导航控制器时,导航控制器不起作用.
But using navigation controller in my apps, the navigation controller doesn't work.
FirstClass *first = [[FirstClass alloc] initWithNibName:@"FirstClass" bundle:nil];
UINavigationController *navigNews = [[[UINavigationController alloc] initWithRootViewController:first] autorelease(or retain)];
[self.navigationController pushViewController:navigNews animated:YES];
那么如何在我的应用程序中添加导航控制器.如果我在根视图中添加了导航控制器,我就会遇到一些问题.那么如何在特定视图中添加导航控制器.
So how can i add the navigation controller in my application. If i have added the navigation controller in my root view, i have faced some problem. so how can i add the navigation controller in the particular view.
请帮帮我.
谢谢!
推荐答案
尝试添加:
[self.view addSubview:navigNews.view];
[self.view addSubview:navigNews.view];
这篇关于如何在 iPhone 的基于视图的应用程序中添加导航控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!