ios - Hiding UITextView and UILabels in Autolayout -


i have picker view , when user picks value picker view want hide textviews , labels together:

[label1] [----textview1----]

[label2] [----textview2----]

[label3] [----textview3----]

so want is:

if (picker value equal "somevalue") {  - hide label 2 , textview 2  - shift label 3 , text view 3 positioned below label 1 , textview1 } 

i tried this solution change priorities , this solution still no luck. need hide label , textview @ once.

set constraints this

then looks in gif

code keep 3 property

@property (weak, nonatomic) iboutlet uilabel *secondlabel; @property (weak, nonatomic) iboutlet uitextfield *secondtextfield; @property (weak, nonatomic) iboutlet nslayoutconstraint *tochangeconstraint; 

then hide

  self.secondlabel.hidden = true; self.secondtextfield.hidden = true; self.tochangeconstraint.constant = -20; [uiview animatewithduration:0.5 animations:^{     [self.view layoutifneeded]; }]; 

then outlet constraint one


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -