When I hide a UIView
inside UIStackview
, on iOS 11 it nicely removes the gap and brings the adjacent UIViews
closer inside the UIStackView
. However, on iOS 10 it will not move the adjacent views and just leave the gap for the hidden view. Is there a way to get around it without having to manually move the views.
Asked
Active
Viewed 3,544 times
7

Kashif
- 4,642
- 7
- 44
- 97
1 Answers
18
Have you added your own height constraint to the UIView? It will cause a conflict with the constraint height = 0
generated by the UIStackView when the UIView is hidden on iOS 10. Just lower the Priority of UIView height constraint (e.g. 999) and the UI will update properly.

Will
- 426
- 4
- 7