Hiding view in stack view in iOS 10
Asked Answered
U

1

7

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.

Unoccupied answered 25/11, 2017 at 17:54 Comment(0)
H
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.

enter image description here

Higgler answered 18/1, 2018 at 2:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.