简体   繁体   English

适用于各种设备的Android图像

[英]Android Images for various devices

I have question regarding Android Layouts.I have read the documentation of Layouts .My question is that while developing lets say if the images are placed in the folders named 我有关于Android Layouts的问题。我已经阅读了Layouts的文档。我的问题是在开发时可以说图像是否放在名为的文件夹中

 drawable-hdpi
 drawable-ldpi
 drawable-mdpi
 drawable-xhdpi

Does drawable-ldpi refers to the phones with smaller screen ,drawable-xhdpi for tabs and drawable-mdpi medium sized screen phones. drawable-ldpi是否指的是屏幕较小的手机,tab和drawable-mdpi中型屏幕电话是指drawable-xhdpi。

If not i have a image i need to be able to put into all types of devices namingly phone,tab 如果没有图像,我需要能够命名为所有类型的设备,例如电话,标签

How can i do it. 我该怎么做。

usually, larger screens have higher DPIs, but that is not always the case. 通常,较大的屏幕具有较高的DPI,但并非总是如此。 if you are trying to differentiate between phone and tablet screens, density is not the right way. 如果您试图区分手机屏幕和平板电脑屏幕,则密度不是正确的方法。 use the following, 使用以下内容,

  • drawable : phones drawable :电话
  • drawable-sw600dp : 7" tablets drawable-sw600dp :7英寸平板电脑
  • drawable-sw720dp : 10" tablets drawable-sw720dp :10英寸平板电脑

alternatively, you can use the screen size: small , medium , large , xlarge . 或者,您可以使用屏幕尺寸: smallmediumlargexlarge eg, drawable-large . 例如drawable-large from the docs, 从文档中

  • xlarge screens are at least 960dp x 720dp xlarge屏幕至少为960dp x 720dp
  • large screens are at least 640dp x 480dp large屏幕至少为640dp x 480dp
  • normal screens are at least 470dp x 320dp normal屏幕至少为470dp x 320dp
  • small screens are at least 426dp x 320dp small萤幕至少为426dp x 320dp

http://developer.android.com/guide/practices/screens_support.html http://developer.android.com/guide/practices/screens_support.html

Googling Android xhdpi brings up the Android resource on how you should use these: 谷歌搜索Android xhdpi出了有关如何使用这些功能的Android资源:

http://developer.android.com/guide/practices/screens_support.html http://developer.android.com/guide/practices/screens_support.html

DPI means how many dots per inch there are. DPI表示每英寸有多少个点。 Some small phones fit lots of dots in, which gives them a high DPI. 一些小型电话可容纳很多点,这使它们具有很高的DPI。 You should provide different sized images for different resolutions. 您应该为不同的分辨率提供不同尺寸的图像。 Google recommends creating images in the ration of 3:4:6:8 for l, m, h and xh DPIs. Google建议为l,m,h和xh DPI创建3:4:6:8比例的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM