3

I have set up vertical UIStackView with couple of UIView's and UIColectionView. Everything works fine until I hide UICollectionView. When I unhide UICollectionView by setting NO for .hidden property. Collection view resizes properly with animation. But problem is none of its collection cells gets resized back to original size. I have a workaround to solve this by calling reloadData on collection view. But I feel this seems to be indication of some bug.

Any suggestion/pointers greatly appreciated.

user1150393
  • 139
  • 1
  • 15
  • 1
    Stack view changes the auto layout constraints to hide the sub view with animation. But when sub view is made visible again, it only reset the collection view constraints. But constraints related to cells are not reset. Invalidating layout will fix this issue. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewLayout_class/index.html#//apple_ref/occ/instm/UICollectionViewLayout/invalidateLayout However this must be a bug with stack view. It must invalidate its subviews. – user1150393 Jul 15 '16 at 23:39

0 Answers0