如何在uinavigationcontroller里添加一个view
1个回答
2016-07-22
展开全部
通过appDelegate,也不用IB的方式,用代码来实现,为一个ViewController添加一个NavigationController,并且声明一下他的rootViewcontroller,求高人指点
<pre class="brush:objc; toolbar: true; auto-links: false;">
GroupsController *groupsController = [[[GroupsController alloc] initWithNibName:nil bundle:nil] autorelease];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:groupsController];
[myViewController presentModalViewController: navigationController];
</pre>
<pre class="brush:objc; toolbar: true; auto-links: false;">
GroupsController *groupsController = [[[GroupsController alloc] initWithNibName:nil bundle:nil] autorelease];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:groupsController];
[myViewController presentModalViewController: navigationController];
</pre>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询