UIImagePickerControllerSourceTypeCamera 导航问题
我有一个警报,询问用户是否想要来自照片应用程序或相机的图片(UIImagePickerControllerSourceTypePhotoLibrary
或 UIImagePickerControllerSourceTypeCamera
)。
当用户在这两种情况下选择图像时,我会像这样推送一个视图控制器:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage *pickedImage = [info
objectForKey:UIImagePickerControllerOriginalImage];
PhotoViewController* controller = [[PhotoViewController alloc]initWithNibName:@"PhotoViewController" bundle:nil photo:pickedImage];
[picker pushViewController:controller animated:YES];
}
当用户选择 UIImagePickerControllerSourceTypePhotoLibrary 时,没有问题,因为我的控制器将位于 UINavigatorController 内部。因此用户可以返回到之前的导航。
但是,当用户选择 UIImagePickerControllerSourceTypeCamera
时,UINavigation 不在我的视图顶部。我需要它,因为我想创建一个取消按钮。
我在这两种情况下使用相同的视图。
请问您对我有什么建议吗?用户拍照后,如何从 PhotoViewController 中的 UIImagePicker 看到 UINavigation?
多谢
I have an alert that asks user if he/she want a picture from Photo App or Camera (UIImagePickerControllerSourceTypePhotoLibrary
or UIImagePickerControllerSourceTypeCamera
).
When the user selects the image in both case, I push a view controller like that:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage *pickedImage = [info
objectForKey:UIImagePickerControllerOriginalImage];
PhotoViewController* controller = [[PhotoViewController alloc]initWithNibName:@"PhotoViewController" bundle:nil photo:pickedImage];
[picker pushViewController:controller animated:YES];
}
When users choose for UIImagePickerControllerSourceTypePhotoLibrary
there is no problem, because my controller will be inside the UINavigatorController. So user can go back to previous Navigation.
But when users choose for UIImagePickerControllerSourceTypeCamera
the UINavigation is not in the top of my view. I need it because I want to create a CANCEL button.
I use the same view in both case.
Do you have a suggestion for me, please? How could I see the UINavigation from the UIImagePicker in my PhotoViewController after user takes a picture?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 PhotoViewControler 中使用此代码来解决我的问题:
I used this code in my PhotoViewControler to solve my problem: