Mipmap 与可绘制文件夹 [英] Mipmaps vs. drawable folders

查看:36
本文介绍了Mipmap 与可绘制文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Android Studio 1.1 Preview 1.我注意到当我创建一个新项目时,我得到以下层次结构:

I'm working with Android Studio 1.1 Preview 1. I noticed that when I create a new project I'm getting the following hierarchy:

不同 DPI 的 Mipmap 文件夹,不再有不同的 DPI 可绘制文件夹.

Mipmap folders for different DPIs, no more different DPIs drawable folders.

我应该将所有资源放在 mipmap 文件夹中,还是只放在应用程序图标中?

Should I put all my resources in the mipmap folders, or just the app icon?

推荐答案

mipmap 文件夹仅用于放置您的应用程序/启动器图标(显示在主屏幕上).您使用的任何其他可绘制资源都应像以前一样放在相关的可绘制文件夹中.

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.

根据 这篇 Google 博文:

最佳做法是将您的应用图标放在 mipmap- 文件夹(而不是 drawable- 文件夹)中,因为它们的使用分辨率与设备的当前密度不同.

It’s best practice to place your app icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device’s current density.

在引用 mipmap- 文件夹时,请确保使用以下引用:

When referencing the mipmap- folders ensure you are using the following reference:

android:icon="@mipmap/ic_launcher"

他们使用不同密度的原因是一些启动器实际上显示的图标比它们预期的要大.因此,他们使用大一码.

The reason they use a different density is that some launchers actually display the icons larger than they were intended. Because of this, they use the next size up.

这篇关于Mipmap 与可绘制文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆