简体   繁体   中英

Screen sizes of android design in pixels?

As I found in android documentation site, the there are 4 general sizes for android devices screens. but I found the measurements unit in dp . like this :

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

How to do that on photoshop, how to get the sizes in pixels ? Do I need to have 4 design ldpi , mdpi , hdpi and xhdpi ? do I need to have 16 versions of the design. ?

yes you have 4 designs like :

xhdpi = 100% image
hdpi = 75% image of xhdpi image
mdpi = 50% image of xhdpi image
ldpi = 50% image of hdpi image

ie :

if you have 96 x 96 image in xhdpi then, you need to put

72 x 72 in hdpi folder - ( 75 % of xhdpi )
48 x 48 in mdpi folder - ( 50 % of xhdpi )
36 x 36 in ldpi folder - ( 50 % of hdpi )

How to do that in Photoshop ?

Just create a high res version of your image with width and height as multiple of 16

Then use my Photoshop Output Android Assets script to generate

  • down-scaled version of images
  • AND " drawable-XXXX " folders for them

Why 16 pixels? For good down-scaling results:

ldpi   mdpi   tvdpi     hdpi    xhdpi   xxhdpi  xxxhdpi
0,75   1      1,33      1,5     2       3       4
3      4      5,32      6       8       12      16

Check my SO answer here for more information: What is the best way to create drawables for different dpi

With my app I chose one screen size for it Hdpi And only used one image android:background="@drawable/imagename"

If you want one for all sizes make one image Resize it for each one Then edit the XML file so that it can be used by the activity

See there are may ways, If your background has repeating patterns you can use nine png,you ll get a lot on the internet for the same. But if there is no repeating pattern u hve to make 4 images

to do you need to target screen fist for example you target xhdpi then its 960px*720 pixel with density per inch as 320px

now in photoshop make your all designs with considering max length as 960px and max width as 720px keep density as 320. Now to scale change the density of images as 240 for hdpi 160 for mdpi and 120 now your images will increase in size now scale them as mentioned by ajay in above answer

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