简体   繁体   中英

How to make my layout look simillar in all Android devices?

I want to know how can I achieve this using dimens file.

I have tried creating dimens file for different densities and smallest screen width but I don't know how much size I should specify in each file.

For example in dimens.xml I have <dimen name="title_margin">8dp</dimen> then how much it should be in other dimens files?

Which one is correct for creating dimens file: either to go with Smallest Screen width or Density?

You don't have to create your own dimensions, There's this cool library called SDP - a scalable size unit https://github.com/intuit/sdp

They have already mapped all dimensions for different densities.

They also have a library for text sizes too - SSP - a scalable size unit for texts https://github.com/intuit/ssp

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