Closed toddrick closed 9 years ago
Actually, a hidden subview DO affect the layout, UIStackView adds a width/height constraint of zero constant
to make that hiding view "collapsed" , other constraints are still connecting against it, a zero width or height makes it not rendering.
With FDStackView, it does not respect this. If you modify your demo project to sit views as hidden, the behavior differs depending on which iOS version you are running. I would consider this a bug.
@sunnyxx If FDStackView can't animate hidden property as UIStackView can, this issue should remain open, don't you think?
实际上 UIStackView 是不对 Hidden 的 Subview 做 layout 计算的,WWDC 201717#412 有提到,目前这个问题还是存在的,iOS 8 上不能通过设置 hidden 对 FDStackView 的 subviews 动态显示和隐藏
One of the perks of UIStackView is that hidden views do not affect the layout. So if a view is marked as hidden it's as if it didn't exist. This behavior is absent from iOS8, where marking a view as hidden will still force it to occupy it's space.