菜鸟教程小白 发表于 2022-12-11 19:15:50

ios - UITabBarController 在通话或个人热点期间被按下?


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

<p> <img src="/image/EYBKR.png" width="333"/> </p>

<p>所以,我的应用程序有一个 Storyboard ,在 Storyboard 中我只是有一个 TabBarController 指向其他 4 个 ViewController 。</p>

<p>知道为什么会这样吗?我该如何解决这个问题,以使应用不会在底部离开屏幕?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我有同样的错误,但我有容器 ViewController ,其中 tabbarcontroller 作为 subviewController 。我通过添加约束来解决这个问题:(我使用制图)</p>

<pre><code>    constrain(tabBarController.view, containerView) { (tabBarControllerView, containerView) in
      tabBarControllerView.height == containerView.height
      tabBarControllerView.width == containerView.width
    }
</code></pre>

<p>如果你添加 tabbarcontroller 作为 initialViewController (rootViewController) 一切都应该没问题</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - UITabBarController 在通话或个人热点期间被按下?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/42822437/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/42822437/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - UITabBarController 在通话或个人热点期间被按下?