0

I am trying to show UIDocumentPickerViewController modally. Its showing but the scroll view inside UIDocumentPickerViewController is not showing some part from top, I have to scroll down to see the content, once released, again goes back to top. Image(see image).

This is how I am trying!

let documentPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.image", "public.audio", "public.movie", "public.text", "public.item", "public.content", "public.source-code"],
                                                                                          in: .import)

        if #available(iOS 11.0, *) {
            documentPicker.allowsMultipleSelection = true
        } else {
            // Fallback on earlier versions
        }

        self.present(documentPicker, animated: true,
                     completion: nil)
infiniteLoop
  • 2,135
  • 1
  • 25
  • 29

1 Answers1

1

Setting uinavigation bar appearance globally to false solved the issue:

UINavigationBar.appearance().isTranslucent = false

but this still seems to be hack as it will affect other areas of app where the isTranslucent needs to be 'true'.

If someone finds a better solution please update. :)

Pang
  • 9,564
  • 146
  • 81
  • 122
infiniteLoop
  • 2,135
  • 1
  • 25
  • 29
  • Another observation, when I added this fix, now its working fine from top, but at bottom, some parts of scrollview is still hidden. – infiniteLoop May 16 '18 at 05:02