Thursday, 15 January 2015

Change frame programmatically with auto layout

1. Create a height constarint for your view in your interface.
2. Then add an IBOutlet object in your class for this constraint. for example,

 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightConstraint;



Connect this object in your connection panel.

3. Then change the value of this constraint whenever you needed

 self.heightConstraint.constant = 40;

No comments:

Post a Comment