PresentViewController是一个带有UINavigationController的非全屏UIViewController

编程入门 行业动态 更新时间:2024-10-24 16:29:35
本文介绍了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/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 developer.apple/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

本文发布于:2023-07-11 12:22:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1094047.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是一个   全屏   PresentViewController   UIViewController   UINavigationController

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!