简体   繁体   English

如何根据stackview的高度动态调整视图的高度?

[英]How adjust the dynamically the height of a view based on height of stackview?

I have a problem with one of my VC.我的一位 VC 有问题。 I need to resize a view depending on the height size of the stack view because the stack view have 2 textedit but in some cases one of them it's hidden.我需要根据堆栈视图的高度大小调整视图的大小,因为堆栈视图有 2 个 textedit,但在某些情况下,其中一个是隐藏的。

Here is the view that contains the stackview this one needs to adjust the height depending on the height of the stackview这是包含堆栈视图的视图,此视图需要根据堆栈视图的高度调整高度容器视图

Here is the stackview contents, the stackview adjust perfectly depending if one of the textedit it's hidden or not but content view not, only leave the blank space under the stackview这是stackview的内容,stackview可以根据其中一个textedit是否隐藏而完美调整,但内容视图不是,只在stackview下留下空白堆栈视图

These are the constraints of the container view.这些是容器视图的约束。 容器视图的约束

Any suggestion to achieve the goal (?)实现目标的任何建议(?)

Please share the screenshot for constraints so I can guide you better?请分享限制条件的屏幕截图,以便我更好地指导您? What we do is we don't give any height constraint to the stack view.我们所做的是我们不给堆栈视图任何高度限制。 The views at the top and bottom then adjust themselves when the stack changes its height due to the subview hidden/show.当堆栈由于子视图隐藏/显示而改变其高度时,顶部和底部的视图会自行调整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM