2013-02-18 61 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