Is there a way to position it divided into auto-layout ratios (ex. positioned 1/3 of the device)

Asked 2 years ago, Updated 2 years ago, 122 views

When using Auto Layout, is there a way to make sure that the subview is located one-third of the device?

swift autolayout xcode

2022-09-22 14:50

2 Answers

And choose EqualHeights

Set the EqualHeightsConstraints setting to 1:3 as shown below

You can add the subview you want to be located at 1/3 point and set the vertical margin of the subview you added above to zero.


2022-09-22 14:50

Hello.

The article below shows how to position according to the relative proportions.


2022-09-22 14:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.