1
{
self.imagePickerController = [[[UIImagePickerController alloc] init ] autorelease];
imagePickerController.view.frame=CGRectMake(0, 0, 1024, 768);
self.imagePickerController.delegate = self;
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
//Set Notifications so that when user rotates phone, the orientation is reset to landscape.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
//Refer to the method didRotate:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:@"UIDeviceOrientationDidChangeNotification" object:nil];
//Set the picker source as the camera
self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
//Bring in the picker view
[self presentModalViewController:self.imagePickerController animated:YES];
}
どのような問題がありますか、説明できますか? –
[このリンクを試す] [1] [1]:http://stackoverflow.com/questions/538041/uiimagepickercontroller-camera-preview-is-portrait-in-landscape-app –
以上実行した後コード私はBAD_Excessを得た –