1
誰もがiPhoneの写真アプリのように風景モードでUIImagePickerControllerSourceTypePhotoLibraryを表示する方法を知っていますか?UIImagePickerControllerSourceTypePhotoLibraryをランドスケープモードで表示する方法
- (void)getPhotoFromSource:(UIImagePickerControllerSourceType)sourceType;
{
if ([UIImagePickerController isSourceTypeAvailable:sourceType])
{ photoPicker.sourceType = sourceType;//UIImagePickerControllerSourceTypePhotoLibrary
[self presentViewController:photoPicker animated:YES completion:nil];
//[self presentModalViewController:photoPicker animated:YES];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error accessing media" message:@"Device doesn't support media source" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
[alert show];
}
}
[この質問] [1]への回答を確認してください。 [1]:http://stackoverflow.com/questions/2083672/uiimagepickercontroller-in-landscape –
こんにちはマイケル、 はそれは私のために動作しません、 'UIDevice' の目に見える@interfaceを宣言していませんセレクタ 'setOrientation:' 私は[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]を設定します。 – Desmond