在UIImagePickerController前面插入视图 [英] insert view in front of UIImagePickerController

查看:46
本文介绍了在UIImagePickerController前面插入视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码在UIImagePickerContrller前面插入视图

I use the codes below to insert view in front of UIImagePickerContrller

[self.view insertSubview:myFrontView atIndex:1000];

有效.

但是,如果ViewController与自我"有关,则是由UINavigationController提出的,

But if the ViewController relates to the 'self' was presented by UINavigationController,

myFronView将显示在UIImagePickerController的后面,而不是显示在它的前面.

myFronView will display behind UIImagePickerController rather than display in front of it.

有人遇到过同样的问题吗?

Is there anyone met the same problem?

欢迎发表评论

谢谢

interdev

推荐答案

您需要将子视图添加到UIImagePickerController的视图中,而不是添加到导航堆栈顶部的视图控制器的视图中,因为您的控制器的视图不会继续在显示UIImagePickerController的视图时可见.

You would need to add your subview to the UIImagePickerController's view rather than to the view of the view controller on top of the navigation stack since your controller's view is not going to be visible when the UIImagePickerController's view is displayed.

但是,将您自己的子视图放入由您未编写的控制器(如UIImagePickerController)管理的视图层次结构中可能会导致问题.如果可能的话,您应该使用UIImagePickerController的 cameraOverlayView属性,以受支持的方式显示您的自定义视图.

However sticking your own subviews into a view hierarchy managed by a controller you did not write (like UIImagePickerController) might cause problems. If at all possible you should be using UIImagePickerController's cameraOverlayView property to display your custom view in a supported way.

这篇关于在UIImagePickerController前面插入视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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