Constraint to bottom layout guide with TabBar issue

喜你入骨 提交于 2019-12-18 19:33:34

问题


I have UITabBarController based iPad app with containerView on the first tab. The containerView has standard vertical spacing to bottom layout guide. When I tap on the second tab and then go back to the first tab, my container moves down by 56 pts, the height of the tabBar and is then covered by the tabBar.

I made 3 screenshots to illustrate that. The third screenshot shows hidden tabBar after the jump between tabs. It looks like the bottom layout guide went down to the edge. What is going on here?


回答1:


I'm not sure about what happened here, but I think that this could help:

Uncheck Under bottom bar in your UIViewController properties

Hope that will help!




回答2:


Nicolas Bonnet's answer of unchecking "Extend Edges Under Bottom Bar" didn't work for me. In my case the problem seemed to be that I was setting the bottom constraint of my view equal to the Bottom Layout Guide.

So, instead, I aligned the bottom edges of my button and the ViewController's view as shown below.

Select both your view to pin to the bottom and the main view:

Then tap the Align selection menu at the bottom right of Interface Builder and select Bottom Edges:



来源:https://stackoverflow.com/questions/21850831/constraint-to-bottom-layout-guide-with-tabbar-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!