ios - UIView 覆盖全屏,覆盖来自 UITabBarController 的选项卡

标签 ios uitabbarcontroller uitabbar

我有一个 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/

相关文章:

android - 需要的跨平台 2d 游戏引擎选择

ios - 使用 iOS Storyboard我无法将标签放在 View Controller 上我想要的位置

iphone - 界面方向和 UITabBarController 的问题

ios - TabBarController App 上的 presentModalViewController - dismissModalViewController 后的空白屏幕

ios - 如何在标签栏 View Controller 中显示后退按钮?

iphone - UIKit中的类如何实现深拷贝?

ios-charts 缺少 PieChart 的标签(图例)

iphone - 如何像 UIButton 选择一样选择 UITabBarItem

swift - Tabbar 在 segue 之后不显示?

swift - 点击 TabBar 时更新当前 UIViewController UI