Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从仪表板切换回主页后,屏幕覆盖未覆盖iOS中的整个屏幕_Ios_Objective C - Fatal编程技术网

从仪表板切换回主页后,屏幕覆盖未覆盖iOS中的整个屏幕

从仪表板切换回主页后,屏幕覆盖未覆盖iOS中的整个屏幕,ios,objective-c,Ios,Objective C,我正在屏幕上[在视图的自定义控制器类中]添加一个灰色UIView覆盖。当它从仪表板回到主屏幕时,它没有覆盖整个屏幕。当我在主屏幕上调用覆盖时,它将正确地覆盖所有内容 UIView *grayOverlay = [[UIView alloc] initWithFrame:self.view.frame]; [grayOverlay setBackgroundColor:[UIColor colorWithWhite:0.1 alpha:0.9]

我正在屏幕上[在视图的自定义控制器类中]添加一个灰色UIView覆盖。当它从仪表板回到主屏幕时,它没有覆盖整个屏幕。当我在主屏幕上调用覆盖时,它将正确地覆盖所有内容

        UIView *grayOverlay = [[UIView alloc] initWithFrame:self.view.frame];           
        [grayOverlay setBackgroundColor:[UIColor colorWithWhite:0.1 alpha:0.9]];
        [self.view addSubview:grayOverlay];
编辑:也许这就是我需要做的:

与“self.view.frame”相反,self.view.frame很奇怪,因为它只是在5s上,当它返回时没有覆盖它


耸耸肩

当它没有覆盖整个屏幕时,什么是
self
?您是否有
UINavigationController
uitabarviewcontroller
?灰色叠加的目的是什么?它是一个UIViewController。这很奇怪,因为它会在分段后完全覆盖iPad屏幕。它似乎只是没有涵盖iphone5s。用户登录时会出现灰色覆盖。听起来您可能正在做一些我使用GitHub上的开源库MBProgressHUD解决的事情。如果要查看它,请查看
dimsBackground
属性。如果这不是你想要的,请告诉我。
UIView *grayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];