我一直在处理QLPreviewController,并遇到导航栏被状态栏重叠的问题。下面是我遇到这个问题的步骤:导航栏在QLPreviewController中被状态栏重叠
- 点击UI以模态启动QLPreviewController。这在这里工作正常。我看到导航栏和状态栏正确对齐。
- 点击加载到QLPreviewController中的视图。导航栏是隐藏的。
- 再次在加载到QLPreviewController中的视图中再次点击。显示导航栏,导航栏与状态栏重叠。请参阅附件截图。
任何想法这里有什么可能是错的?
PS:这只发生在横向模式下。肖像模式工作正常。
这是我的代码:
QLPreviewController *aQLPreviewController = [[QLPreviewController alloc] init];
aQLPreviewController.dataSource = self;
aQLPreviewController.delegate = self;
[myViewController presentViewController:aQLPreviewController animated:YES completion:NULL];
QLPreviewController委托方法:
- (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;
}