我使用以下代码从我的iPad应用程序打开相机或图库。它只支持横向。
我已经实现了以下代码:
UIImagePickerController *picker=[[UIImagePickerController alloc] init];
picker.delegate=self;
#if TARGET_IPHONE_SIMULATOR
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
#else
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
picker.showsCameraControls=YES;
[picker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff];
#endif
CGAffineTransform transform=picker.view.transform;
transform= CGAffineTransformMakeRotation(-90*M_PI/180);
[picker setCameraViewTransform:transform];
[self presentModalViewController:picker animated:YES];
请帮忙。