Sha*_*hay 2 screen objective-c uiview ios uistatusbar
当我用UIView覆盖所有屏幕时,如何用UIView覆盖UIStatusBar?
我也在争取如何做这个很长一段时间!终于想通了:)关键是将新窗口的windowLevel设置为非常高,以便它存在于所有其他窗口/视图/状态栏等之上:
UIWindow *keyWin = [UIApplication sharedApplication].keyWindow;
UIWindow *hudWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0.0f, 0.0f, keyWin.frame.size.width, keyWin.frame.size.height)];
hudWindow.backgroundColor = [UIColor blackColor];
hudWindow.alpha = 0.60;
[hudWindow setWindowLevel:10000.0f];
[hudWindow setHidden:NO];
Run Code Online (Sandbox Code Playgroud)
请享用!