在我的iOS应用程序我已经隐藏状态栏与此代码中的每个视图控制器:IOS 7文档交互控制器隐藏状态栏
- (BOOL)prefersStatusBarHidden
{
return YES;
}
在视图中我需要使用UIDocumentInteractionController,但说到状态栏出现,是否有办法隐藏它?
在此先感谢
在我的iOS应用程序我已经隐藏状态栏与此代码中的每个视图控制器:IOS 7文档交互控制器隐藏状态栏
- (BOOL)prefersStatusBarHidden
{
return YES;
}
在视图中我需要使用UIDocumentInteractionController,但说到状态栏出现,是否有办法隐藏它?
在此先感谢
设置documentController.delegate
自我和使用
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller {
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
使用来自iOS的下面的代码的组合代码:
- (UIViewController *) documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *) controller {
// hack to keep status bar visible
[[NSOperationQueue mainQueue] addOperationWithBlock:
^{
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}];
return self;
}
与
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller {
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
合并
试试这个适用于我的作品:
- (void)documentInteractionControllerWillBeginPreview:(UIDocumentInteractionController *)controller
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
这不适用于iOS 7 :-( – allemattio