Ios 如何在面向风景的UIImagePickerController中解决画廊滚动条结巴的问题?

Ios 如何在面向风景的UIImagePickerController中解决画廊滚动条结巴的问题?,ios,performance,uiimagepickercontroller,Ios,Performance,Uiimagepickercontroller,我尝试了几种不同的方法,在我正在开发的一个只支持横向的应用程序(不是我自己选择的)中展示一个面向横向的UIImagePickerController 当我(成功地)以横向格式展示画廊并滚动图片时,真是可怕的口吃 我目前使用的技术是: - (void)presentImagePickerController:(UIImagePickerControllerSourceType)sourceType { UIImagePickerController *picker = [[UIImageP

我尝试了几种不同的方法,在我正在开发的一个只支持横向的应用程序(不是我自己选择的)中展示一个面向横向的UIImagePickerController

当我(成功地)以横向格式展示画廊并滚动图片时,真是可怕的口吃

我目前使用的技术是:

- (void)presentImagePickerController:(UIImagePickerControllerSourceType)sourceType {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];

    if (isDeviceIPad) {
        picker.modalPresentationStyle = UIModalPresentationFormSheet;
        picker.preferredContentSize = [UIScreen mainScreen].bounds.size;
    }

    picker.sourceType = sourceType;
    picker.delegate = self;
    picker.allowsEditing = YES;
    [self presentViewController:picker
                       animated:YES
                     completion:nil];
}
我不能使用使用私有接口的解决方案,因为该应用程序必须通过应用商店审查。我不想使用第三方图书馆,因为我的老板反对这个想法


我的iPad是第三代MD334LL/a型,运行iOS 8.1。

来自以下UIImagePickerController类参考:

在iPad上,显示图像选择器的正确方式取决于其源类型,如下表所示:

摄像机:使用全屏

照片库:必须使用popover

已保存的相册:必须使用popover

回答:因为我想展示保存的相册,所以我需要使用popover来展示选择器

- (void)presentImagePickerController:(UIImagePickerControllerSourceType)sourceType {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];

    picker.sourceType = sourceType;
    picker.delegate = self;
    picker.allowsEditing = YES;

    if (isDeviceIPad() && sourceType == UIImagePickerControllerSourceTypeSavedPhotosAlbum) {
        picker.modalPresentationStyle = UIModalPresentationPopover;

        UIPopoverPresentationController *presentationController = picker.popoverPresentationController;
        presentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
        presentationController.sourceView = self.presentPickerButton;
        presentationController.sourceRect = self.presentPickerButton.bounds;
    }

    [self presentViewController:picker
                       animated:YES
                     completion:nil];
}

从此处找到的UIImagePickerController类引用:

在iPad上,显示图像选择器的正确方式取决于其源类型,如下表所示:

摄像机:使用全屏

照片库:必须使用popover

已保存的相册:必须使用popover

回答:因为我想展示保存的相册,所以我需要使用popover来展示选择器

- (void)presentImagePickerController:(UIImagePickerControllerSourceType)sourceType {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];

    picker.sourceType = sourceType;
    picker.delegate = self;
    picker.allowsEditing = YES;

    if (isDeviceIPad() && sourceType == UIImagePickerControllerSourceTypeSavedPhotosAlbum) {
        picker.modalPresentationStyle = UIModalPresentationPopover;

        UIPopoverPresentationController *presentationController = picker.popoverPresentationController;
        presentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
        presentationController.sourceView = self.presentPickerButton;
        presentationController.sourceRect = self.presentPickerButton.bounds;
    }

    [self presentViewController:picker
                       animated:YES
                     completion:nil];
}

iPad3存在性能问题。它的硬件对于视网膜显示来说实在太慢了。在我的iPad上,当它是人像的时候,画廊的滚动非常平滑。但是这样它的图像空间就少了。iPad3有性能问题。它的硬件对于视网膜显示来说实在太慢了。在我的iPad上,当它处于人像模式时,画廊的滚动非常平滑。但是这样的话,它的图像空间就更少了。