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.
Hiding view in stack view in iOS 10
Asked Answered
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.
© 2022 - 2024 — McMap. All rights reserved.