iPad相机定位问题

时间:2013-02-18 06:03:49

标签: objective-c ipad ios5 ios6 camera

我正在实施一个关于摄像机模式功能的应用程序,但应用程序仅运行横向但摄像机在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;

}

1 个答案:

答案 0 :(得分:0)

将方向设置为:

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