PresentViewController是一个带有UINavigationController的非全屏UIViewController [英] PresentViewController a non full screen UIViewController with UINavigationController in it

查看:774
本文介绍了PresentViewController是一个带有UINavigationController的非全屏UIViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚是否有办法呈现一个不是全屏的UIViewController。它应该是自定义大小&不是使用modalPresentationStyle可以实现的。

I am trying to figure out if there is a way to present a UIViewController which is not full screen. It should be of custom size & not what can be achieved using modalPresentationStyle.

我想用UINavigationController创建一个类似本地Twitter / Facebook共享表大小的视图,这样我就可以推送/弹出更多的UIViewControllers。它适用于iPhone和iPad。

I wanted to create a view like the native Twitter/Facebook sharing sheet's size with UINavigationController so that I can push/pop more UIViewControllers. It should work for iPhone and iPad.

推荐答案

您可以使用View Controller Containment来执行此操作。请参阅 http中的实现容器视图控制器 ://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html 了解更多信息。基本上你只需要调用addChildViewController:在将子视图添加到视图之前,并在删除它之前删除.FromParentViewController:

You can use View Controller Containment to do this. See "Implementing A Container View Controller" at http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html for more info. Basically you just need to call addChildViewController: before adding the child's view to your view, and removeFromParentViewController: before removing it.

这篇关于PresentViewController是一个带有UINavigationController的非全屏UIViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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