使用presentViewController时,取消按钮在iOS 5上出现禁用
在 iOS 4 上,我使用以下代码行来获取 PhotoLibrary 及其工作完美,并且可以通过右上角出现的取消按钮来关闭视图:
[self presentModalViewController:imgPicker animated:YES];
但是,在 iOS 5 上,以下行获取 PhotoLibrary 但“ “取消按钮”被禁用,即视图不能通过取消按钮关闭。
[self presentViewController:imgPicker animated:YES completion:nil];
on iOS 4 i am using the following line of code to get the PhotoLibrary and its working perfect and the view can be dismissed with the cancel button appearing on top right side:
[self presentModalViewController:imgPicker animated:YES];
However, on iOS 5 the following line is getting the PhotoLibrary but the "Cancel Button" is Disable, i.e. the view cannot be dismissed with cancel button.
[self presentViewController:imgPicker animated:YES completion:nil];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我来说效果很好,在 iOS 5 中也是如此。
This works fine for me, in iOS 5, too.
您传递的不是视图控制器,而是视图控制器类。尝试使用旧的
imgPicker
而不是UIImagePickerController
。另外,Objective C 中没有
Nil
这样的东西。它应该是nil
。You are not passing a view controller, but a view controller class. Try using your old
imgPicker
rather than theUIImagePickerController
.Also, there is no such thing as
Nil
in objective C. It should benil
.