-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行直接崩溃 #46
Comments
- (UIView *)statusBarUIview{
if(@available(iOS 13,*)){
int tag = 13004352;
UIWindow *window = [UIApplication sharedApplication].delegate.window;
UIView *view = [window viewWithTag:tag];
if (view) {
return view;
}else{
CGRect statusBarRect = [UIApplication sharedApplication].statusBarFrame;
UIView *statusBarView = [[UIView alloc]initWithFrame:statusBarRect];
statusBarView.tag = tag;
[window addSubview:statusBarView];
return statusBarView;
}
}else{
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
return statusBar;
}
}
return nil;
} |
setStatusBarBackgroundColor 崩溃了= =。。 看了上边代码大概知道问题了= =。。求github上版本更新下 |
在BaseViewController中得 setStatusBarBackgroundColor ,将里面的代码注释了即可,原因是iOS13以后,系统会自动调用status bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.'
The text was updated successfully, but these errors were encountered: