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:
UPDATE the solution is to link the constraint from the storyboard to the custom class then a apply this solution:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.