安卓屏幕分辨率
我正在关注本教程链接
有三种类型的屏幕
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
但是我在三个文件夹
drawabale-hdpi
drawabale-mdpi
drawabale-ldpi
中放置了xlarge的图像高清晰度 mdpi 中的大值 和 ldpi 正常值 但是小屏幕的图像应该放在哪里呢? 抱歉英语不好
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是两个不同的东西 - hdpi/mdpi/ldpi 是屏幕密度(即每平方厘米有多少像素),而 xlarge/large/normal/small 是屏幕尺寸(屏幕的物理尺寸)。因此,小屏幕图像将进入drawable-small,正常进入drawable-normal,等等。
Android 开发者网站。
These are two different things - hdpi/mdpi/ldpi are screen densities (i.e., how many pixels per square centimeter) while xlarge/large/normal/small are screen sizes (the physical dimensions of the screen). So the small screen images would go in drawable-small, normal in drawable-normal, etc.
There's a lot more info about this stuff on the Android developer website.
屏幕尺寸与密度无关。 xlarge 屏幕并不意味着它具有 hdpi 密度。例如,像 Galaxy 10.1 pr motorola xoom 这样的选项卡具有 xlarge 屏幕,但 mdpi 密度,因此您可以为它们创建一个单独的文件夹drawable-xlarge。为此,您必须在清单中添加
android:xlargeScreens="true"
。Galaxy s2 或 htcdesire 等设备具有 hdpi 密度。像 Galaxy Pop 这样的小屏幕设备大多具有 ldpi 密度,像 Galaxy ace 这样的普通屏幕大多是 mdpi 设备,而像 Galaxy s2 这样的大屏幕设备大多是 hdpi 设备,而像 tab P1000 这样的一些设备有大屏幕,但 mdpi 密度和对于他们来说你必须创建文件夹drawable-large-mdpi。
Screen size has no relation with density. xlarge screen does not mean it has hdpi density. For example tab like galaxy 10.1 pr motorola xoom has xlarge screen but mdpi density so for them you make a separate folder drawable-xlarge. and for this you have to add
android:xlargeScreens="true"
in manifest.And devices like galaxy s2 or htc desire has hdpi density. Devices with small screens like galaxy pop are mostly have ldpi density, normal screens like galaxy ace are mostly mdpi devices and devices with large screens like galaxy s2 are mostly hdpi devices, and some devices like tab P1000 have large screens but mdpi density and for them you have to make folder drawable-large-mdpi.
例如,以下是应用程序中的资源目录列表,该应用程序为不同的屏幕尺寸提供不同的布局设计,并为小、中、高和超高密度屏幕提供不同的位图可绘制对象。
和屏幕尺寸。
我希望这有帮助。
For example, The following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for small, medium, high, and extra high density screens.
and Screen Sizes.
I hope this help.
hdpi
、mdpi
和ldpi
是指以每英寸点数为单位的屏幕密度。这与屏幕尺寸(小、大等)完全分开。您可以拥有低密度的大屏幕,也可以拥有高密度的小屏幕等。
您可以通过在
res/layout-small
、res/ 中放置不同的布局资源来满足不同的屏幕尺寸。布局大
等hdpi
,mdpi
andldpi
refer to the screen density in dots-per-inch. This is completely separate from the screen size (small, large, etc).You can have large screen with low density, or a small screen with high density, etc.
You can cater for different screen sizes by putting different layout resources in
res/layout-small
,res/layout-large
, etc.