UIView *statusBarView = [[UIApplication sharedApplication] valueForKey:@"statusBar"];
此种方式已经不可取了,会造成crash
报: 2019-10-05 22:39:36.247299+0800 JDBusinessApp[60459:3825394] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3899.13.13/UIApplication.m:5240
2019-10-05 22:39:36.253913+0800 JDBusinessApp[60459:3825394] *** 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.'
网友评论