- (void)viewDidAppear:(BOOL)animated {
[superviewDidAppear:animated];
UIView*statusBarView;
if(@available(iOS13.0, *)) {
statusBarView = [[UIView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame];
statusBarView.backgroundColor= [UIColorcolorWithHexString:@"#5a9eff"];
[[UIApplication sharedApplication].keyWindow addSubview:statusBarView];
}else{
statusBarView= [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if([statusBarViewrespondsToSelector:@selector(setBackgroundColor:)]) {
statusBarView.backgroundColor= [UIColorcolorWithHexString:@"#5a9eff"];
};
}
}
网友评论