为什么不能将UIImagePickerController推入导航堆栈? [英] Why can’t UIImagePickerController be pushed into navigation stack?
本文介绍了为什么不能将UIImagePickerController推入导航堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用pushViewController
推动UIImagePickerController
时:
[self.navigationController pushViewController:pvc animated:YES];
将发生错误,例如:
不支持按导航控制器
Pushing a navigation controller is not supported
正确的解决方案是使用presentModalViewController
:
The right solution is to use presentModalViewController
:
[self presentModalViewController:pvc animated:YES];
有人可以解释为什么这是必要的吗? UIViewController
中隐藏了什么?
Can someone explain why this is necessary? What‘s hidden in UIViewController
?
谢谢!
推荐答案
Apple不允许堆叠导航栏.由于图像选择器具有自己的导航栏,因此无法将其放置在导航堆栈中.由于会有两个栏,两组导航项,两个标题等,因此结果会引起用户混乱.
Apple does not allow stacking of navigation bars. Since the image picker has its own navigation bar, it cannot be placed in a navigation stack. The result would cause user confusion since there would be two bars, two sets of navigation items, two titles, etc.
这篇关于为什么不能将UIImagePickerController推入导航堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文