ImagePicker icon indicating copy to clipboard operation
ImagePicker copied to clipboard

Gallery is not showing in full height

Open Zwei-wei opened this issue 4 years ago • 9 comments

I am a developer integrating this IMG picker to our apps. While testing on my iPhone 11, the gallery is not showing in full height. It looks like the gallery is hidden behind the bottom container. I will paste my code here.

extension FloorPlanViewController: ImagePickerDelegate {
    func wrapperDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
        self.imagePickerController?.expandGalleryView()
    }
    
    func doneButtonDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
        for image in images {
            self.currentPhotoUploader?.addImage(image: image)
        }
        self.currentPhotoUploader = nil
        self.imagePickerController?.resetAssets()
        self.imagePickerController?.dismiss(animated: true, completion: nil)
    }
    
    func cancelButtonDidPress(_ imagePicker: ImagePickerController) {
        self.imagePickerController?.dismiss(animated: true, completion: nil)
    }
}
private func initImagePicker() {
        let configuration = Configuration()
        configuration.recordLocation = false
        configuration.collapseCollectionViewWhileShot = true
        imagePickerController = ImagePickerController(configuration: configuration)
        imagePickerController?.delegate = self
}

Zwei-wei avatar Jul 22 '20 19:07 Zwei-wei

I am using the newest Xcode + iPhone 11 with the newest system by the way~

Zwei-wei avatar Jul 22 '20 19:07 Zwei-wei

I got the same issue

Zheng-Shuo avatar Jul 24 '20 03:07 Zheng-Shuo

Same here, wasn't sure if it was a SwiftUI issue or not

jacobsapps avatar Sep 01 '20 15:09 jacobsapps

Same here, wasn't sure if it was a SwiftUI issue or not

Definitely not SwiftUI, I am not using SwiftUI in the current project

Zwei-wei avatar Sep 04 '20 02:09 Zwei-wei

Hi this project is in maintenance mode and no further work has been planned, I'm happy to assist if someone wants to look into fixing this issue. Thanks!

3lvis avatar Oct 04 '20 09:10 3lvis

@jacobsapps @Zheng-Shuo @3lvis I have found the reason why it works like this. Because I am using IOS 13.0+ so by default if you do this present(imagePickerController, animated: true, completion: nil) it will be presented as a slidable modal which might be the reason why the Gallery part of the ImagePick is not showing in full height. So It is easy to avoid if you add imagePickerController?.modalPresentationStyle = .fullScreen before you present the ImagePicker. I still consider it as a bug, cause I thought it should be working in this scenario.

Zwei-wei avatar Oct 10 '20 00:10 Zwei-wei

Hi @Zwei-wei I thought I had fixed this. Let me double check.

3lvis avatar Oct 10 '20 09:10 3lvis

@3lvis I tried the newest version through pod update, if I switch back to default not using .fullScreen, the bottom Galley can still only show like half of the image.

Zwei-wei avatar Nov 11 '20 00:11 Zwei-wei

it's easy to fix, just in ImagePickerController.swift: var totalSize: CGSize { return UIScreen.main.bounds.size } => var totalSize: CGSize { return self.view.bounds.size }

xinyu-DGS avatar Jan 06 '23 10:01 xinyu-DGS