I have been dealing with QLPreviewController for the first time and running into an issue of navigation bar getting overlapped by status bar. Below are the steps I ran into this issue with:
- Tap on UI to launch the QLPreviewController modally. This works fine here. I see nav bar and status bar properly aligned.
- Tap inside the view loaded in QLPreviewController. Navigation bar is hidden.
- Tap again inside the view loaded in QLPreviewController. Navigation bar is shown back with nav bar overlapped by status bar. Please see the attached screenshot.
Any idea what could be wrong here?
PS: This is happening only in Landscape mode. Portrait mode its working fine.
This is my code:
QLPreviewController *aQLPreviewController = [[QLPreviewController alloc] init];
aQLPreviewController.dataSource = self;
aQLPreviewController.delegate = self;
[myViewController presentViewController:aQLPreviewController animated:YES completion:NULL];
QLPreviewController delegate methods:
- (NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *)iController {
return 1;
}
- (id <QLPreviewItem>) previewController: (QLPreviewController *) iController previewItemAtIndex: (NSInteger) iIndex {
if (iIndex == 0) {
return self.myURL;
} else {
return nil;
}
}
- (void)previewControllerDidDismiss:(QLPreviewController *)iController {
self.myURL = nil;
}