2

I know we should use dp/sp instead of px in UI design, but the UI designer I work with just gives me his design in pixels in 1280x720. How should I convert the pixels in 1280x720 to dp/sp, and support multiple screens?

I checked the doc, 30px in 1280x720 = 15dp in xhdpi. Should I make a /values-xhdpi/dimen.xml file in my project? And what about other resolutions? How should I deal with ldpi, mdpi, hdpi, xxhdpi, xxxhdpi?

Also, I got the text sizes in pixels too. Do I need to do the same thing as I did with dp?

Pang
  • 9,564
  • 146
  • 81
  • 122
TimmyMa
  • 175
  • 1
  • 1
  • 8

1 Answers1

1

Check this -

1) What is the difference between "px", "dp", "dip" and "sp" on Android?

2) Android screen size HDPI, LDPI, MDPI

Hope it will help :)

Community
  • 1
  • 1
Onkar Nene
  • 1,359
  • 1
  • 17
  • 23