OGeek|极客世界-中国程序员成长平台

标题: ios - UITabBarController 在通话或个人热点期间被按下? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:15
标题: ios - UITabBarController 在通话或个人热点期间被按下?

我试图弄清楚为什么会在我的应用程序中发生这种情况。如图所示,我的应用程序被推下屏幕,而不是正确调整大小以适应电话或个人热点事件造成的大小变化......

所以,我的应用程序有一个 Storyboard ,在 Storyboard 中我只是有一个 TabBarController 指向其他 4 个 View Controller 。

知道为什么会这样吗?我该如何解决这个问题,以使应用不会在底部离开屏幕?



Best Answer-推荐答案


我有同样的错误,但我有容器 View Controller ,其中 tabbarcontroller 作为 subview Controller 。我通过添加约束来解决这个问题我使用制图)

    constrain(tabBarController.view, containerView) { (tabBarControllerView, containerView) in
        tabBarControllerView.height == containerView.height
        tabBarControllerView.width == containerView.width
    }

如果你添加 tabbarcontroller 作为 initialViewController (rootViewController) 一切都应该没问题

关于ios - UITabBarController 在通话或个人热点期间被按下?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42822437/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4