0

Code for the thing

let fileBrowser = UIDocumentPickerViewController(documentTypes: listOfAllTypesOfFiles, in: UIDocumentPickerMode.open)
fileBrowser.allowsMultipleSelection = false
fileBrowser.delegate = self
            
navigationController?.present(fileBrowser, animated: true, completion: nil)

Not sure why, but it shows that empty space at the bottom. Anyone knows what that is?

This is how it looks

2
  • that seems like that some of your views try to out-smart either extedned-edges or safe-area or bottom-layout-guideline and it does it wrongly – post more code / info about how to set up your view's contraints or extended edges. Commented Nov 2, 2020 at 14:57
  • @holex I'm a bit confused. That's a system component. Originally I had an issue with transparent background of search bar at the top, but it was fixed via appearance. But I don't know how it's possible to overwrite edges for how ui is constructed in system component. Commented Nov 3, 2020 at 9:35

3 Answers 3

1

Found the issue. It was customizing tab bar via appearance. In particular that big chunk of view was some messed up version of shadow image which looks fine in main app, but not so much there. Don't customize your stuff like that people :)

Sign up to request clarification or add additional context in comments.

Comments

1

It turns out that I had a global appearance() customisation causing issues with the document picker.

In my case this was the line causing the issue, removing it enabled the UIDocumentPickerViewController to display correctly.

UITabBar.appearance().isTranslucent = false

I've applied the appearance to my UITabBar directly instead of globally.

Alexander above (although downvoted) helped track the solution. Hope this helps whoever comes after.

Comments

0

I had a similar problem. In my case it was

UITabBar.appearance().isTranslucent = false

I created my own UIDocumentPickerViewController and am using it.

final class SbisDocumentPickerViewController: UIDocumentPickerViewController {
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        let toolbar = UIToolbar.appearance()
        toolbar.isTranslucent = true
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        
        let toolbar = UIToolbar.appearance()
        toolbar.isTranslucent = false
    }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.