在容器中嵌入导航控制器 - 目标 C [英] Embedding a navigation controller in a container - Objective C

查看:40
本文介绍了在容器中嵌入导航控制器 - 目标 C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在容器视图中嵌入导航控制器?当我放置容器时,第一个显示的是嵌入到容器中的 viewController,我想将该 viewController 更改为导航视图并将其设置为 rootViewController 和其他视图

How to embed a Navigation controller in a container View? When I place the container the first this that shows is a viewController embed to the container, I want to change that viewController to a navigation view and set it rootViewController and other views

推荐答案

基本上只需将 ViewController 添加到 UINavigationController 并将 UINavigationController 设置为您的 rootViewController.希望有所帮助:

Basically just add the ViewController into a UINavigationController and set the UINavigationController as your rootViewController. Hope that helps:

ViewController *vc = [[ViewController alloc] init];
UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
self.window.rootViewController = nvc;

这篇关于在容器中嵌入导航控制器 - 目标 C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆