如何更改iPAD中UIImagePickerController的大小?

如何更改iPAD中UIImagePickerController的大小?,ipad,Ipad,如何在iPAD中增大UIImagePickerController的尺寸?两个应用程序的示例 代码已经完成了 - (void)openCamera { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { camera = [[UIImagePickerController alloc] init]; camer

如何在iPAD中增大UIImagePickerController的尺寸?两个应用程序的示例

代码已经完成了

- (void)openCamera {

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        camera = [[UIImagePickerController alloc] init];
        camera.sourceType = UIImagePickerControllerSourceTypeCamera;
        camera.cameraDevice = UIImagePickerControllerCameraDeviceFront;
        camera.delegate = self;

        [self presentViewController:camera sender:nil animated:YES modal:YES];
    }
    else 
    {
        UIAlertView *objAlert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Camera not found" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

        [objAlert show];
        [objAlert release];
    }
}


- (void)presentViewController:(UIViewController *)vc
                       sender:(id)sender
                     animated:(BOOL)animated
                        modal:(BOOL)modal {

    CGRect cframe = self.capturedImage.bounds;
    //cframe =  CGRectMake(cframe.origin.x, cframe.origin.y/2.0, 351, 351);


    photoPopoverController = [[UIPopoverController alloc] initWithContentViewController:vc];
    [photoPopoverController presentPopoverFromRect:[capturedImage bounds] inView:capturedImage permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];
}

您应该更改其视图的框架属性。 即


它应该会起作用。否则,请提供有关如何创建控制器、如何显示控制器以及哪些是其代理的更多详细信息。

您应该更改其视图的frame属性。 即

它应该会起作用。否则,请提供有关如何创建控制器、如何显示控制器以及哪些是其委托的更多详细信息。

您可以使用transform:

//变换因子

#定义摄像机_变换0.34及以上

如上所述,如果要调整其大小,请使用:

camera.wantsFullScreenLayout=是

camera.cameraViewTransform=CGAffineTransformScale(camera.cameraViewTransform,camera\u TRANSFORM,camera\u TRANSFORM)

您可以使用转换:

//变换因子

#定义摄像机_变换0.34及以上

如上所述,如果要调整其大小,请使用:

camera.wantsFullScreenLayout=是

camera.cameraViewTransform=CGAffineTransformScale(camera.cameraViewTransform,camera\u TRANSFORM,camera\u TRANSFORM)


请给我们更多的细节,或者一些代码看看。如何实例化和显示该控制器?您正在读取和修改帧,但没有重新分配它。这样,您的自定义就丢失了。嘿@marzapower,我从您给定的解决方案中得到了我想要的,但它没有调用imagePickerController的委托方法该怎么办?您只需通过
imagePickerController.delegate=yourDelegate
设置委托即可。一些代码会有帮助,但这也是另一个问题。请给我们更多的细节,或一些代码看。如何实例化和显示该控制器?您正在读取和修改帧,但没有重新分配它。这样,您的自定义就丢失了。嘿@marzapower,我从您给定的解决方案中得到了我想要的,但它没有调用imagePickerController的委托方法该怎么办?您只需通过
imagePickerController.delegate=yourDelegate
设置委托即可。一些代码会有帮助,但这也是另一个问题。这是一个相当老的线程,但我需要做同样的事情。。。你有没有找到一个解决方案???如果你找到了解决方案,然后提交这个答案,可能会对其他人有所帮助。这是一个相当古老的线程,但我需要做同样的事情。。。你有没有找到解决方案???如果你找到了解决方案,那么提交这个答案,可能会对其他人有所帮助。
UIView *view = imagePickerController.view;
CGRect frame = view.frame;
frame.size.height = new_height;
frame.size.width = new_width;
view.frame = frame;