Instead of Fill
, change the Distribution
of the UIStackView
to Fill Proportionally
and add constraints for the width of each element. Those constraints will serve as a guide to proportions on one element to each other and not as fixed sizes.
I tried it the following way. The overall set up is given in pic:
At run time result is as given:
From control and drag select equal width. as shown
Hope it can help
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.