I have a UIView
which contains, let's say, 7 objects (UILabel
). The size is fixed.
In some case, I must hide some of the objects. I do it with setHidden:YES
.
The problem is that the appearance of the view is not very appealing, because the position of the objects is fixed. It could be better if the objects can freely move up and down when space is available...
Asked
Active
Viewed 569 times
0

gdm
- 7,647
- 3
- 41
- 71
2 Answers
0
I build category to update constraints easily:
To hide uiview, just do it:
//Hide View
[myView1 setConstraintConstant:0 forAttribute:NSLayoutAttributeHeight];
Answer here: Hide autolayout UIView : How to get existing NSLayoutConstraint to update this one

Community
- 1
- 1

Damien Romito
- 9,801
- 13
- 66
- 84