安卓屏幕分辨率

发布于 2024-12-08 17:04:43 字数 466 浏览 2 评论 0 原文

我正在关注本教程链接

有三种类型的屏幕

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 正常值 但是小屏幕的图像应该放在哪里呢? 抱歉英语不好

I am following this tutorial link

There three types of screens

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

But there are three folders

drawabale-hdpi
drawabale-mdpi
drawabale-ldpi

I placed images of xlarge in hdpi
that of large in mdpi
and that of normal in ldpi
but where to place the images of small screens?
Sorry for bad english

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

云归处 2024-12-15 17:04:44

这是两个不同的东西 - 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.

唐婉 2024-12-15 17:04:44

屏幕尺寸与密度无关。 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.

苏佲洛 2024-12-15 17:04:43

例如,以下是应用程序中的资源目录列表,该应用程序为不同的屏幕尺寸提供不同的布局设计,并为小、中、高和超高密度屏幕提供不同的位图可绘制对象。

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

res/drawable-mdpi/my_icon.png        // bitmap for medium density
res/drawable-hdpi/my_icon.png        // bitmap for high density
res/drawable-xhdpi/my_icon.png       // bitmap for extra high density

屏幕尺寸

我希望这有帮助。

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.

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

res/drawable-mdpi/my_icon.png        // bitmap for medium density
res/drawable-hdpi/my_icon.png        // bitmap for high density
res/drawable-xhdpi/my_icon.png       // bitmap for extra high density

and Screen Sizes.

I hope this help.

权谋诡计 2024-12-15 17:04:43

hdpimdpildpi 是指以每英寸点数为单位的屏幕密度。这与屏幕尺寸(小、大等)完全分开。

您可以拥有低密度的大屏幕,也可以拥有高密度的小屏幕等。

您可以通过在 res/layout-smallres/ 中放置不同的布局资源来满足不同的屏幕尺寸。布局大

hdpi, mdpi and ldpi 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文