Question for calculating view coordinate values according to Android resolution

Asked 2 years ago, Updated 2 years ago, 22 views

If the view is located at x:300 y 300 on a 1280 x 800 screen.

When the resolution changes to 1080 x 700 like this, I want to place the View in a relatively same position, so is there a formula for calculating the coordinate value?

android

2022-09-21 17:18

1 Answers

If you use ConstraintView + GuideLine, You can specify a location value of %.

Or https://github.com/ssomai/ScalableLayout.


2022-09-21 17:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.