我在屏幕上添加了一个灰色的 UIView 覆盖层 [在 View 的自定义 Controller 类中]。当它从仪表板返回到主屏幕时,它并没有覆盖整个屏幕。当我调用主屏幕上的叠加层时,它会正确覆盖所有内容
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?
最佳答案
UIView *grayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
工作与“self.view.frame”相反,这很奇怪,因为它只在 5s 上,当它返回时没有覆盖它......
耸肩
关于ios - 从仪表板返回主页后,屏幕覆盖未覆盖 iOS 中的整个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28257990/