当我用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];
请享用!
关于ios - 当我用UIView覆盖所有屏幕时,如何也用UIView覆盖UIStatusBar? (苹果手机),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2080714/