hyperoslo / ImagePicker

:camera: Reinventing the way ImagePicker works.
Other
4.86k stars 676 forks source link

Gallery is not showing in full height #460

Open Zwei-wei opened 4 years ago

Zwei-wei commented 4 years ago

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 commented 4 years ago

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

Zheng-Shuo commented 4 years ago

I got the same issue

jacobsapps commented 4 years ago

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

Zwei-wei commented 4 years ago

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

3lvis commented 3 years ago

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!

Zwei-wei commented 3 years ago

@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.

3lvis commented 3 years ago

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

Zwei-wei commented 3 years ago

@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.

xinyu-DGS commented 1 year ago

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 }