Hide right thumbnail in QLPreviewController

I was not able to hide the right thumbnail panel when clicked when I add the QLPreviewController as a childview controller. I am using the following code:

#import <QuickLook/QuickLook.h> -(void)viewDidLoad { if ([QLPreviewController canPreviewItem:[[NSBundle mainBundle] URLForResource:@"myFile" withExtension:@"pdf"]]) { QLPreviewController *previewController = [[QLPreviewController alloc] init]; previewController.dataSource = self; [self addChildViewController:previewController]; [viewQuickLook addSubview:previewController.view]; [previewController didMoveToParentViewController:self]; } } -(NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller { return 1; } - (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index { NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"myFile" withExtension:@"pdf"]; return pdfURL; } 

While I use the following code, I can hide the thumbnail panel when clicked.

 QLPreviewController *previewController = [[QLPreviewController alloc] init]; previewController.dataSource = self; [self presentViewController:previewController animated:YES completion:nil]; 

But I do not want the QLPreviewController navigation bar.

+5
source share

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


All Articles