横屏下的ImagePickerController
2014-10-20 13:25
302 查看
Try this way....
For disable Landscape mode only for ImagePicker Controller follow below code.
In your ViewController.m
Make the SubClass(NonRotatingUIImagePickerController) of Image Picker Controller
Use as follow
This is working for me & Let me know if you have any Problem.
补充,需要再AppDelegate下面添加如下代码:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationMaskAll;
}
As per Apple Document, ImagePicker Controller never Rotate in Landscape mode. You have to use in Potrait Mode only.
For disable Landscape mode only for ImagePicker Controller follow below code.
In your ViewController.m
Make the SubClass(NonRotatingUIImagePickerController) of Image Picker Controller
@interface NonRotatingUIImagePickerController : UIImagePickerController @end @implementation NonRotatingUIImagePickerController // Disable Landscape mode. - (BOOL)shouldAutorotate { return NO; } @end
Use as follow
UIImagePickerController* picker = [[NonRotatingUIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; picker.delegate = self; etc.... Just as Default ImagePicker Controller
This is working for me & Let me know if you have any Problem.
补充,需要再AppDelegate下面添加如下代码:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationMaskAll;
}
相关文章推荐
- ELCImagePickerController 同时选择多张图片时,获取文件名称
- iOS 横屏中添加UIImagePickerController获取系统图片
- 第12月第25天 ImagePickerSheetController
- [IOS 图像处理]--相机的各种处理效果DLCImagePickerController
- UIPinchGestureRecognizer 缩放,移动,旋转,UIImagePickerController 横屏,全屏 的实现
- imagePickerController 拍照内存不足问题。
- IOS6横屏调用UIUIImagePickerController闪退的解决方案
- Image Picker Controller
- iPhone - UIImagePickerController -> save the image to app folder
- imagePickerController 获取图片的拍照时间等信息
- imagePickerController中info的对应的所有值
- 不使用UIImagePickerControllerOriginalImage获取相册图片
- 不使用UIImagePickerControllerOriginalImage获取相册图片
- UIPinchGestureRecognizer 缩放,移动,旋转,UIImagePickerController 横屏,全屏 的实现
- ZCImagePickerController框架简介
- 如何在ImagePickerController中只显示图片或者视频
- IOS - 使用 QBImagePickerController 从系统相册选取多张照片
- UIPinchGestureRecognizer 缩放,移动,旋转,UIImagePickerController 横屏,全屏 的实现
- TZImagePickerController 的使用
- Update: ELCImagePickerController