将 UIImagePickerController 推到左侧
我正在制作一个相机应用程序,它使用户可以访问照片库。他们触摸按钮,然后使用presentModalViewController弹出UIImagePickerControllerSourceTypeSavedPhotosAlbum。当他们触摸照片时,我想要一个视图将 ImagePicker 推到左侧,然后进入新视图。问题是,我想让 ImagePicker 保持打开状态,这样当他们返回时就不会出现延迟。这种情况发生在许多相机应用程序中,例如 NightCamera。每当我使用 [self.navigationController PushViewController:photoPreview];
时,它会将视图推送到主视图,而不是选择器。当我使用 [picker.navigationController PushViewController:photoPreview];
时,没有任何反应,因为选择器的 navigationController 为零。有人知道该怎么办吗?
I am making a camera app, which gives the user access to the Photo Library. They touch the button, and UIImagePickerControllerSourceTypeSavedPhotosAlbum pops up using presentModalViewController. When they touch a photo, I want a view to push the ImagePicker to the left and the new view to come in. The thing is, I want to keep the ImagePicker up, so when they go back to it there isn't a lag. This happens in many camera apps like NightCamera. Whenever I use [self.navigationController pushViewController:photoPreview];
, it pushes the view to the main view, not the picker. When I use [picker.navigationController pushViewController:photoPreview];
, nothing happens, because the picker's navigationController is nil. Does anyone know what to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的。不存在“模态视图控制器”这样的东西,任何视图控制器都可以模态呈现。
由于
UIImagePickerController
已经是UINavigationController
,因此您可以直接在其上推送视图。因此,不要只是
删除
.navigationController
。Yes it is possible. There is no such thing as "modal view controller", any view controller can be presented modaly.
Since
UIImagePickerController
is already aUINavigationController
, you can push views directly on it. So instead ofjust do
removing
.navigationController
.试试这个:
Try this: