简体   繁体   中英

Resizing a UIStackView using AutoLayout

I have the following setup in my storyboard. I want the selected UIStackView to stretch across it's parents view so its right edge is the same distance away from the edge of the screen as the left edge.

Control dragging from the stackview to it's parent view and selecting "Trailing space to container margin" doesn't do what I thought it would (I am very new to auto layout). What is the correct way to resize this stackview? TIA

在此处输入图片说明

Control click and drag form your stackView to it's superview. Then pick Center Horizontally . Adding a leading constraint should be sufficient.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM