2013-02-18 64 views
0

我正在实施有关摄像机模式功能的应用程序,但应用程序只能运行景观,但摄像机在仅剩下一部分IPad处于黑色状态。IPad摄像机方向问题

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { 
     camPicker.sourceType = UIImagePickerControllerSourceTypeCamera; 
     camPicker.delegate = self; 
     camPicker.allowsEditing = NO; 
     [self presentModalViewController:camPicker animated:YES]; 

对于取向固定为

if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { 
    return interfaceOrientation == UIInterfaceOrientationLandscapeLeft; 

}else 
{ 
    return interfaceOrientation == UIInterfaceOrientationLandscapeRight; 

} 
+0

直到无法打开相机在全屏!!!! – Byka 2013-02-18 07:59:47

回答

0

设定方向为:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft); 
} 
+0

在iOS 6.x中不使用'shouldAutorotateToInterfaceOrientation ...'方法。 – rmaddy 2013-02-18 06:23:36

+0

ThanQ但直到它作为相似.... – Byka 2013-02-18 09:08:39