[英]Navigation bar getting overlapped by status bar in QLPreviewController
I have been dealing with QLPreviewController for the first time and running into an issue of navigation bar getting overlapped by status bar. 我第一次处理QLPreviewController并遇到状态栏重叠的导航栏问题。 Below are the steps I ran into this issue with:
以下是我遇到此问题的步骤:
Any idea what could be wrong here? 知道这里有什么不对吗?
PS: This is happening only in Landscape mode. PS:这仅在横向模式下发生。 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: 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;
}
It works for me: 这个对我有用:
- (BOOL)prefersStatusBarHidden {
return NO;
}
通过在info.plist中添加UIViewControllerBasedStatusBarAppearance
布尔键并指定值“NO”来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.