我在我的项目中使用广告客户端。广告客户端隐藏应用程序的状态栏。我可以做些什么来强制应用程序显示状态栏吗?
最佳答案
objective-c 中的一些代码,因为我只知道 objective-c
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// Hide the status bar
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
// iOS 7
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
}
- (BOOL)prefersStatusBarHidden
{
return NO;
}
关于ios - 强制应用程序显示状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39485638/