Reputation: 1632
Is there a way to change the constraints? I want to change the height, centerX and centerY of the button if the device is in landscape mode.
Upvotes: 1
Views: 1817
Reputation: 1340
If you are using Auto-Layout then make outlets of constraints and change your constraint's constant value as per your need.
Example: If your height constraint is heightOfView then set heightOfView.constant = x , in your landscape mode
Upvotes: 0
Reputation: 1247
The size class will help you change the constraints in landscape and portrait mode both and even for the device screen ratio. For more details have a look at Ray wenderlich Auto layout tutorial
Upvotes: -1
Reputation: 2693
You can use different constraints by using Size classes. Size classes allows you to add different constraints for various modes i.e landscape and Portrait for various devices.
Upvotes: 5