我有一个 UITabBarController,我想添加一个 UIView 作为 subview ,但我希望该 View 覆盖整个屏幕,包括底部的选项卡。我所做的所有尝试都导致 View 涵盖了除底部选项卡之外的所有内容。
最佳答案
不确定您尝试了什么,但是,如果您尝试从 UIViewController
添加 View 那是在UITabBarController
里面那么你应该使用:
UIView *coverView = [[UIView alloc] initWithFrame:CGRectMake(0,
0,
self.tabBarController.view.frame.size.width,
self.tabBarController.view.frame.size.height)];
[self.tabBarController.view addSubview:coverView];
//and maybe [self.tabBarController.view bringSubviewToFront:coverView];
关于ios - UIView 覆盖全屏,覆盖来自 UITabBarController 的选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19186079/