0

How to give multiplier to the width and height of the UIImageView .

I need to add the constraint to the image with have a height of 200*400-1x,400*1600-2x .I have set the constraints in the 12.9 iPad .

julie
  • 1
  • 3

2 Answers2

0

Do it programmatically. Create an IBoutlet for your constraints. Update your constraint accordingly. yourConstraint.constant = 200*400-1x

Mark Bell
  • 3,370
  • 1
  • 7
  • 14
0

This constraint give the image view 0.7 of the width of the view

 [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.imageView
      attribute:NSLayoutAttributeWidth 
      relatedBy:NSLayoutRelationEqual 
      toItem:self.view 
      attribute: NSLayoutAttributeWidth 
      multiplier:0.7
      constant:0]];
pkc456
  • 8,256
  • 34
  • 50
  • 104
Sh_Khan
  • 93,445
  • 7
  • 57
  • 76