New a subclass of UIImagePickerController and add this codes:
@property (nonatomic)NSUInteger supportedInterfaceOrientations;
-(NSUInteger)supportedInterfaceOrientations{
return _supportedInterfaceOrientations;
}
-(BOOL)shouldAutorotate{
return YES;
}
Use it like this:
if (imagePickerController==nil) {
imagePickerController = [[WUIImagePickerController alloc]init];//the subclass
imagePickerController.delegate = self;
imagePickerController.supportedInterfaceOrientations = UIInterfaceOrientationMaskLandscapeRight;//any orientation you want to set
if (popoverController==nil) {
popoverController = [[UIPopoverController alloc]initWithContentViewController:imagePickerController];
}
}
Who knows a better way please tell me.