简体   繁体   English

Android应用背景分辨率

[英]Android Application Background Resolution

I want to design a background for android application using Photoshop , let's say I have Samsung S4,So I set the resolution to the maximum of that device which is 1080x1920 and 441dpi 我想用Photoshop设计Android应用程序的背景,假设我有三星S4,所以我将分辨率设置为该设备的最大值1080x1920和441dpi

Now,my question is where should i insert it in what subfolder of Resources and depending on what we choose that folder 现在,我的问题是我应该在哪里插入资源的子文件夹,并根据我们选择的文件夹

-drawable-hdpi -drawable,华电国际
-drawable-ldpi -drawable,LDPI
-drawable-mdpi -drawable-MDPI
-drawable-xhdpi -drawable-xhdpi
-drawable-xxhdpi -drawable-xxhdpi

What image feature decides on which folder image should be in? 什么图像功能决定应该在哪个文件夹图像?

Hopefully, this image will show you which category it falls into: 希望这张图片会告诉你它属于哪个类别: 在此输入图像描述

As you can see everything larger than 400dpi is xxhdpi, so you should place it there. 你可以看到大于400dpi的一切都是xxhdpi,所以你应该把它放在那里。

Also check out the DisplayMetrics page. 另请查看DisplayMetrics页面。

EDIT: To answer your last question. 编辑:回答你的上一个问题。 There isn't any image feature that determines where it belongs, the folders are simply used to load images with different resolutions onto different screens. 没有任何图像功能可以确定它所属的位置,文件夹只是用于将具有不同分辨率的图像加载到不同的屏幕上。 For example if the picture containing text has high resolution and you place it on a low density screen, the text would be (physically) too small to read. 例如,如果包含文本的图片具有高分辨率并且您将其放在低密度屏幕上,则文本(物理上)太小而无法读取。 So you place a higher resolution image in hdpi or xhdpi folder and resize it so it has smaller resolution and place it in ldpi and mdpi folders. 因此,您将更高分辨率的图像放在hdpi或xhdpi文件夹中并调整其大小,使其具有较小的分辨率并将其放在ldpi和mdpi文件夹中。

You should put on drawable-xxhdpi folder. 你应该穿上drawable-xxhdpi文件夹。

A brief explanation about the drawable resources: 关于可绘制资源的简要说明:

The drawable resources are, by default, divided in 6 generalized groups based on its pixel density: 默认情况下,可绘制资源根据像素密度划分为6个广义组:

  • ldpi : Low density drawables (~120 dpi) ldpi :低密度抽屉 (~120 dpi)
  • mdpi : Medium density drawables (~160 dpi) mdpi :中密度可拉伸(~160 dpi)
  • hdpi : High density drawables (~240 dpi) hdpi :高密度抽屉(~240 dpi)
  • xhdpi : XHigh density drawables (~320 dpi) xhdpi :X高密度抽屉(~320 dpi)
  • xxhdpi : XXHigh density drawables (~480 dpi) xxhdpi :XX高密度绘图(~480 dpi)
  • xxxhdpi : XXXHigh density drawables (~640 dpi) xxxhdpi :XXX高密度抽屉(~640 dpi)

The scaling ration between these drawables should be 3:4:6:8:12:16 这些抽签之间的缩放比例应为3:4:6:8:12:16

You only need to provide density-specific drawables for bitmap files (.png, .jpg, or .gif) and Nine-Path files (.9.png). 您只需要为位图文件(.png,.jpg或.gif)和Nine-Path文件(.9.png)提供特定于密度的drawable。 If you use XML files to define shapes, colors, or other drawable resources, you should put one copy in the default drawable directory ( drawable/ ). 如果使用XML文件来定义形状,颜色或其他可绘制资源,则应将一个副本放在默认的可绘制目录( drawable/ )中。

Even if you don't provide alternative drawable resources for the different groups of density, the Android system will find the best matching drawable and scale it for you. 即使您没有为不同的密度组提供替代的可绘制资源,Android系统也会找到最适合的drawable并为您进行扩展。 But is recommended to provide alternative drawable resources in order to ensure to always have smooth drawables in all devices. 但建议提供替代的可绘制资源,以确保在所有设备中始终具有平滑的绘图。

You might want to take a look here . 你可能想看看这里

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

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