2

I am designed my screen in xib using autolayout(xcode 6). I have to redesign the screen programmatically using autolayout.

I have 4 views in my screen horizontally. I have to hide the third view and move the fourth view to third view's position using autolayout.

How do I update the constraint programmatically.

1 Answer 1

3

You may use NSLayoutConstraint and assign proper IBOutlet to any of your constraints and then where you wants to change the view size use constant property of NSLayoutConstraint to change the value. e.g

in your viewController.h
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *tempConstraint;
some where in your viewController.m
tempConstraint.constant = 50; // or what ever you want
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.