Configuring the bottom pane in QLPreviewController

My application integrates QLPreviewController and UIDocumentInteractionController, and it works fine.

The only problem is I want to customize the bottom toolbar, I want to remove the default toolbar items that appear, as shown in the image below:

Bottom tool-bar with items to be removed

Is there any way to do this, please suggest.

+6
source share
4 answers

Short answer: NO, not in iOS6 +

Description:

One note about the QLPreviewController is that it is not intended to be configured. There were other libraries that allowed you to change features such as:

https://github.com/rob-brown/RBFilePreviewer 

Which does not work in iOS 6+, since the apple has changed a lot in the QLPreviewController and it technically works in a separate process. Although it is possible (not sure) to use private apis, your application will be rejected.

You can find more information about this change here: http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/

Hope this helps

+2
source
  • Subclass of UIToolbar
  • Create a UINavigationController using init (navigationBarClass: toolbarClass :) and put the UIToolbar subsclass created in step 1 for toolbarClass
  • Create an instance of QLPreviewController and push the UINavigationController stack
  • Inside UIToolbar subsclass override setItems (_: animated :) . To remove all buttons, call super with an empty array super.setItems([], animated: false) or perhaps you can add only those buttons that you want to keep.
  • There is a UINavigationController created in step 2

Here is an example of PreviewControllerHideBottomButtons

+2
source
  • Subclass of QLPreviewController.
  • Search for a toolbar in a hierarchy of views.
  • You have a UIToolbar property in your class that has the same frame as the original toolbar.
  • Put your toolbar above the default setting with any buttons you want.
  • If you want it to be hidden as the default behavior of the QLPreviewController, you can use the key value for the hidden property of the default toolbar and accordingly present / hide your own.
0
source

Does anyone know how to configure qlPreviewController in Safari? I am trying to show the Object or AR tab in AR Quick Look Preview. Can anyone help?

0
source

Source: https://habr.com/ru/post/955126/


All Articles