【问题标题】:ios - UIView to cover full screen, to cover the tabs from a UITabBarControllerios - UIView 覆盖全屏,覆盖来自 UITabBarController 的选项卡
【发布时间】:2013-10-04 16:17:47
【问题描述】:

我有一个 UITabBarController,我想添加一个 UIView 作为子视图,但我希望该视图覆盖整个屏幕,包括底部的选项卡。我所做的所有尝试都导致视图覆盖了除底部选项卡之外的所有内容。

【问题讨论】:

    标签: ios uitabbarcontroller uitabbar


    【解决方案1】:

    不确定您尝试了什么,但是,如果您尝试从位于 UITabBarController 内的 UIViewController 添加视图,那么您应该使用:

    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];
    

    【讨论】:

    • 谢谢,顺便说一句,最后一个属性应该是 self.tabBarController.view.frame.size.Height。
    猜你喜欢
    • 1970-01-01
    • 2011-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-27
    相关资源
    最近更新 更多