我在屏幕上添加了一个灰色的UIView叠加[在视图的自定义控制器类中]。当它从仪表板切换回主屏幕时,它不会覆盖整个屏幕。当我在主屏幕上调用叠加层时,它将正确覆盖它
UIView *grayOverlay = [[UIView alloc] initWithFrame:self.view.frame];
[grayOverlay setBackgroundColor:[UIColor colorWithWhite:0.1 alpha:0.9]];
[self.view addSubview:grayOverlay];
编辑:也许这就是我需要做的事:iOS: Is there a way to make a viewcontroller look inactive by having everything grayed out?
答案 0 :(得分:1)
UIView *grayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
工作而不是" self.view.frame",这很奇怪,因为它只是在5s时它还没有覆盖它... ...
耸肩