forkingdog / FDStackView

Use UIStackView directly in iOS6+
MIT License
2.53k stars 319 forks source link

Views do not respect 'Hidden' property in iOS 8 like they do in iOS9 #6

Closed toddrick closed 9 years ago

toddrick commented 9 years ago

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.

sunnyxx commented 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.

toddrick commented 9 years ago

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.

nobre84 commented 8 years ago

@sunnyxx If FDStackView can't animate hidden property as UIStackView can, this issue should remain open, don't you think?

eric-samurai commented 6 years ago

实际上 UIStackView 是不对 Hidden 的 Subview 做 layout 计算的,WWDC 201717#412 有提到,目前这个问题还是存在的,iOS 8 上不能通过设置 hidden 对 FDStackView 的 subviews 动态显示和隐藏