objective-c - whose view is not in the window hierarchy! IOS
某草草
某草草 2017-05-02 09:20:08
0
4
704

1.现在遇到的问题是这样子: 工程里有 A B C 三个页面。
A present B页面,B push 到C 页面。
C 页面里有一个UIwebView ,加载了H5页面, H5页面有个按钮调用手机的相册 UIImagePickerController,弹出了拍照,相册选择的UIActionSheet, 然后我点击相册按钮,程序直接退出到了 A 页面。

2.我尝试用A push 到B 页面,B页面push 到C 页面,这样子的话,在点击相册后会到系统相册里面,选择图片后会返回到H5页面里。

3.我现在需要的是present 也能实现而不是用push。 我认为是根控制器的原因。因为C 这个页面是H5去实现的,所以我能做什么?


我尝试了以下方案,

发现只要有present ,就是出现问题,而且提示问题就出现在present 那里

某草草
某草草

reply all(4)
phpcn_u1582

There is a solution you can try: put B and C in a UINavigationController for management, and use A to present the UINavigationController.

Peter_Zhu

If this is to be implemented correctly, A present B page should present not B, but the navigationController with B as the root.

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:BController];
[self presentViewController:navigationController animated:YES completion:nil];
刘奇

Write a solution to this, but I don’t know if there is any problem. This is how I solved it so far.
I guess it’s a problem with the root controller. Then now it’s time to change the root controller

Just modify window.rootviewcontroller, jump to present C and change window.rootviewcontroller
When C returns, change window.rootviewcontroller and change it back.

滿天的星座

Solution
http://www.skyfox.org/present...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!