使用UIWebView上传照片 [英] Upload photo with UIWebView
问题描述
我想直接从UIWebView上传照片,其中包含用于文件上传的HTML表单。当我点击按钮时,我会选择拍照或选择现有照片。但当我点击这两个选项中的任何一个时,我得到
I would like to upload a photo directly from UIWebView that has a HTML form for file upload. When I click on button I get options to take photo or choose existing. But when I click any of these two options I get
警告:尝试提供
< UIImagePickerController:0x15c15e00>
on< UINavigationController:0x155a2660>
,其视图不在窗口层次结构中!
Warning: Attempt to present
<UIImagePickerController: 0x15c15e00>
on<UINavigationController: 0x155a2660>
whose view is not in the window hierarchy!
可以请任何人都能解释我这些警告......
Could please anyone can explain me these warning...
提前谢谢你!
推荐答案
这是iOS 8上的一个错误,当webview以模态方式呈现时会发生。
It's a bug on iOS 8, that happens when the webview is presented modally.
唯一的选择权现在它不是以模态方式呈现webview,你可以用导航控制器呈现它或者切换rootviewcontroller
The only options right now it not to present the webview modally, you can present it with a navigation controller or switching the rootviewcontroller
在这里你可以阅读更多关于bug和建议的解决方案
Here you can read more about the bug and a proposed solution
iOS 8 SDK:模态UIWebView和相机/图像选择器
这篇关于使用UIWebView上传照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!