Hide right button n QLPreviewController?

后端 未结 8 1471
-上瘾入骨i
-上瘾入骨i 2021-01-17 01:35

I am subclassing QLPreviewController in my application and using the following code.

QLPreviewControllerSubClass* preview = [[QLPreviewControllerSubClass all         


        
8条回答
  •  情话喂你
    2021-01-17 02:16

    I'm dealing the same problem also.

    I made the rightBarButton hidden, but may have some problem when the loading of pdf lasts for a long time.

    Below is my process.

    1.Make a sub class of QLPreviewController.

    2.Add a timer to repeats setting the rightBarButton to nil when the class init.

    _hideRightBarButtonTimmer = [NSTimer scheduledTimerWithTimeInterval:0.01
                                                                     target:self
                                                                   selector:@selector(hideRightButton)
                                                                   userInfo:nil
                                                                    repeats:YES];
    

    3.Invalidate the timer in viewDidAppear.

    [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(cancelTimmer) userInfo:nil repeats:NO];
    

    And I found the rightBarButton is setup while the loading of pdf file is finished. If we can detect the event the solution will be much easier and clearer.

    Hopes it will be helpful.

提交回复
热议问题