-1

I have created my viewController with the storyboard. I have like 3 subviews. I used the multiplier in storyboard to fix the height which is proportional to the main view Height. Let say:

Subview1.height = 0.2× height
Subview2.height = 0.5× height
Subview3.height = 0.3× height

(This just an example) I want now to change the height programmatically. I look for a solution like this:

self.Subview1.frame.size.height = 0.5 × self.view.frame.size.height

UPDATE the solution is to link the constraint from the storyboard to the custom class then a apply this solution:

Can I change multiplier property for NSLayoutConstraint?

AndroPro
  • 13
  • 1
  • 7
  • Yes, I did add the height constraints I have created in the storyboard as IBOutlets, but the question is : how to change the height multiplier , I did not find the right code to do it? – AndroPro Mar 30 '19 at 20:07

1 Answers1

0

UPDATE the solution is to link the constraint from the storyboard to the custom class then a apply this solution:

Can I change multiplier property for NSLayoutConstraint?

AndroPro
  • 13
  • 1
  • 7