QLPreviewController navbar is blocking PDF content

I am working on a project that displays a PDF using QLPreviewController

from two different views. One view clicks QLPreviewController

on the base nav and the other the modal view which brings QLPreviewController

up in modal mode.

I had problems when I initially configured this on click, including setting the transparency of the navbar and the nav bar blocking my PDF. I managed to solve both problems by subclassing QLPreviewController


#import "CustomPreviewController.h"

@interface CustomPreviewController ()


@implementation CustomPreviewController

-(id) init {
    self = [super init];
        // init
    } return self;

- (void) viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    // set translucency of navigation bar
    self.navigationController.navigationBar.translucent = NO;
    // nav bar does not overlap content
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.automaticallyAdjustsScrollViewInsets = YES;



However, now I need to view the same PDF from a different stream in the application. For this design, I need a modal popup file before UITableView

, then either push or modal from that tableview to PDF to QLPreviewController

. When I use the same push animation, I get animation delay and breaks and a buggy bar at the top. ( See this post here ). When I use the modal it animates smoothly, but mine UINavigationBar

hides the top of the PDF and covers the page number. Similar symptoms of navigation barrier for problems with clicking on linked mail. I tried the solution suggested there and also tried to hide the navbar of the initial modal and the preview controller, to no avail.

This could be Apple's bug / issue, but if anyone comes across a useful workaround, any suggestions would be greatly appreciated.


source to share

All Articles