我正在实施一个关于摄像机模式功能的应用程序,但应用程序仅运行横向但摄像机在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 :(得分:0)
将方向设置为:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}