隐藏底栏当通过自动布局推 [英] Hide Bottom Bar When Pushed through Autolayout

查看:230
本文介绍了隐藏底栏当通过自动布局推的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的UITabBarController 一个的UINavigationController 持有的UIViewController 作为根视图控制器。

I have a UITabBarController with one UINavigationController holding a UIViewController as root view controller.

轻击按钮中的一个,当的UIViewController ,我把一个普通的聊天窗口的UIViewController (带的TableView +输入查看)结束隐藏底部标签栏。 (使用标志当推隐藏底栏)

when tapping one of the button in the UIViewController, I push a regular chat window UIViewController (with TableView + Input View) end hiding the bottom tab bar. (using the "Hide bottom bar when pushed" flag)

在故事板我添加了一个普通的的UIView 子类VC看起来像一个底吧,我用自动布局,以将其固定到VC视图的底部。

In storyboard I added a regular UIView subclass to VC that look like a bottom bar, and I use Auto Layout to pin it to the bottom of the VC view.

问题
当我把VC需要第二个这种观点引脚的底部,它看起来像自动布局其固定在底部,如果标签栏是不是隐藏和秒后,认识到标签栏被隐藏,移动它到视图的真正底部。

The problem when I push VC it takes a second for this view to pin to the bottom, it looks like auto layout pin it to the bottom as if the tab bar is not hidden and after a sec it recognise that the tab bar is hidden and moves it to the real bottom of the view.

有关明确信息查询这个屏幕截图

For clear info check this screen shot

在这里输入的形象描述

现在,我会让你知道该表视图的限制..

Now I will let you the know the constraints of the table view..

现在我展示InputView的制约

Now I am showing the constraints of the InputView

我也在我的视图层次...

I am also adding my View hierarchy...

在这里输入的形象描述

推荐答案

我在我的项目也有类似的问题。我解决它通过选择我想固定在底部的观点(在你的情况下,输入查看),持有命令,并选择它的父(这两种观点现在应该突出)。

I had a similar issue in my project. I solved it by selecting the view I wanted anchored to the bottom (in your case, the input view), held Command, and selected its superview (both views should be highlighted now).

在这里输入的形象描述

然后我选择了对齐按钮IB的底部:

Then I selected the align button at the bottom of IB:

在这里输入的形象描述

和加入了底部边缘约束。

我做了什么最初使用PIN菜单到视图针到它的父,但现在看来,将其固定到系统默认的底部布局,这会导致在过渡期间怪异的动作。

What I had done initially is used the pin menu to pin the view to its superview, but it appears that will pin it to the bottom layout by default, which causes that weird movement during the transition.

编辑:

看到最新的截图后,问题可能在于在superviews之一。我假设 chatWindow 的UIView 和您的滚动查看只有水平。这是你应该检查什么:

After seeing the latest screenshot, the problem could lie in one of the superviews. I'm assuming that chatWindow is a UIView, and your Scroll View is horizontal only. Here's what your should check:


  1. chatWindow 被固定在滚动视图的底部类似于我上面列出。

  2. 滚动视图被固定到上海华正如我上文所述。

  3. 移动 inputView 滚动视图外根上海华。一个接然后一招下来对当前位置的层次结构。

  1. chatWindow is pinned to the scrollView's bottom similar to what I've outlined above.
  2. scrollView is pinned to its superview as I've outlined above.
  3. Moving the inputView outside of the scrollView to the root superview. Then one by one move it down the hierarchy towards its current location.

这篇关于隐藏底栏当通过自动布局推的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆