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

Bilal Awan
  • 4,730
  • 1
  • 8
  • 15
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,350
  • 38
  • 53
  • 109
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87