0

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

}
4

1 回答 1

0

将方向设置为:

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
于 2013-02-18T06:21:25.147 回答