Search code examples
iphoneiosobjective-cios7

contentInset for QLPreviewController


I am refactoring my app for iOS 7, i have a view controller with UIToolBar in the top and below that QLPreviewController. I set the UIToolBar translucent to YES and the origin y of the QLPreviewController is the same as the toolbar`s y origin (so i will be able to see the QLPreviewController behind the tool bar).

Right now the content of the QLPreviewController is cut and i would like to set the content inset to begin at 44.0 (toolbar's height) and not 0.0.

screenshot: enter image description here

Can i access the QLPreviewController`s ScrollView? How do i do it?

Thanks !


Solution

  • You can set extendedLayoutIncludesOpaqueBars to NO:

    QLPreviewController *previewViewController = [[QLPreviewController alloc] init];
    previewViewController.extendedLayoutIncludesOpaqueBars = NO;
    //code for push/present previewViewController
    

    or set edgesForExtendedLayout to UIRectEdgeNone:

    QLPreviewController *previewViewController = [[QLPreviewController alloc] init];
    previewViewController.edgesForExtendedLayout = UIRectEdgeNone;
    //code for push/present previewViewController