2

I have image with some width, that related to superview with some percentage for portrait mode. When device orientation change to landscape mode how to change the percentage in storyboard by changing the multiplier value.

enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253

2 Answers2

2

Unfortunately you can't change the multiplier, but you can add two constraints, one with the landscape multiplier and another for the portrait multiplier.

Then in code you can activate/deactivate the constraints when the rotation occurs.

If you get an error in the storyboard just set the priority of one of the constraint to 999 or something under the other.

LorenzOliveto
  • 7,796
  • 1
  • 20
  • 47
0

We can't the multiplier as it is get only property, but we can adjust width or height constant to match with multiplier.

https://stackoverflow.com/a/53043586/5519329

Sateesh Yemireddi
  • 4,289
  • 1
  • 20
  • 37