为了账号安全,请及时绑定邮箱和手机立即绑定

android studio上面的图片应该放在drawable还是mipmap里面呢?

http://img1.sycdn.imooc.com//550e39d80001d7d503260386.jpg

需要在drawable上面建立drawable-hdpi之类的文件夹,然后再把图片放进去吗

正在回答

12 回答

上面提到的那个stackoverflow 的链接:http://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders

1 回复 有任何疑惑可以回复我~

dsfd

0 回复 有任何疑惑可以回复我~

查了一下

官方介绍:
Mipmapping for drawables
Using a mipmap as the source for your bitmap or drawable is a simple way to provide a quality image and various image scales, which can be particularly useful if you expect your image to be scaled during an animation.
Android 4.2 (API level 17) added support for mipmaps in the Bitmap class—Android swaps the mip images in your Bitmap when you've supplied a mipmap source and have enabled setHasMipMap(). Now in Android 4.3, you can enable mipmaps for a BitmapDrawable object as well, by providing a mipmap asset and setting the android:mipMap attribute in a bitmap resource file or by calling hasMipMap().

图片文件都建议放在mipmap中。

0 回复 有任何疑惑可以回复我~

但是在select文件里不好引用啊怎么办啊

0 回复 有任何疑惑可以回复我~

Mipmapping for drawables

Using a mipmap as the source for your bitmap or drawable is a simple way to provide a quality image and various image scales, which can be particularly useful if you expect your image to be scaled during an animation.

Android 4.2 (API level 17) added support for mipmaps in the Bitmap class—Android swaps the mip images in your Bitmap when you've supplied a mipmap source and have enabled setHasMipMap(). Now in Android 4.3, you can enable mipmaps for a BitmapDrawable object as well, by providing a mipmap asset and setting the android:mipMap attribute in a bitmap resource file or by calling hasMipMap().


0 回复 有任何疑惑可以回复我~

我猜谷歌的意思是除了启动图片,其他的图片没必要分那么细,麻烦。。  哈哈哈哈

1 回复 有任何疑惑可以回复我~

如果谷歌官方强烈建议使用 mipmap 装图片,那为什么官方Material Design Icon的图片是打包到 drawable 下面, 打自己脸么?

0 回复 有任何疑惑可以回复我~

谷歌官方:

drawable/

For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe Drawable shapes or Drawable objects that contain multiple states (normal, pressed, or focused). See the Drawable resource type.

mipmap/

For app launcher icons. The Android system retains the resources in this folder (and density-specific folders such as mipmap-xxxhdpi) regardless of the screen resolution of the device where your app is installed. This behavior allows launcher apps to pick the best resolution icon for your app to display on the home screen. For more information about using the mipmap folders, see Managing Launcher Icons as mipmap Resources.


6 回复 有任何疑惑可以回复我~
#1

安全撤离

顶楼上 被骗了好久
2015-12-11 回复 有任何疑惑可以回复我~

想问一下,drawable文件为空如何设置到eclipse上的那种模式

0 回复 有任何疑惑可以回复我~
首页上一页12下一页尾页

举报

0/150
提交
取消
Android攻城狮的第一门课(入门篇)
  • 参与学习       312585    人
  • 解答问题       4633    个

想快速掌握Android应用开发基础,选择学习这门课程就对了。

进入课程

android studio上面的图片应该放在drawable还是mipmap里面呢?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信