如何通过代码设置Navigation Controller 为root view controller
2个回答
展开全部
通过appDelegate,也不用IB的方式,用代码来实现,为一个ViewController添加一个NavigationController,并且声明一下他的rootViewcontroller,求高人指点
GroupsController *groupsController = [[[GroupsController alloc] initWithNibName:nil bundle:nil] autorelease];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:groupsController];
[myViewController presentModalViewController: navigationController];
</pre>
GroupsController *groupsController = [[[GroupsController alloc] initWithNibName:nil bundle:nil] autorelease];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:groupsController];
[myViewController presentModalViewController: navigationController];
</pre>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询