Android Studio的mipmap文件夾

Android Studio建立的工程下有一個mipmap文件夾,莫名其妙的,想知道跟drawable文件夾有什麼關係。而後Google了一圈,在StackOverflow上找到的答案比較靠譜,這裏複製過來,稍做翻譯:html

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.android

mipmap文件夾僅僅是用於放置應用的啓動圖標(就是如今是桌面上的那個圖標)。其餘的圖片資源仍是跟之前同樣,放在與屏幕尺寸相對應的drawable圖片資源文件夾下面。app

According to this Google blogpost: 根據Google的官方博客解釋:post

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文件夾下面是你的最優選擇,由於系統會根據當前設備的像素來採用不一樣的策略優化圖標的顯示。this

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

若是你的啓動圖片放置在mipmap下面,那麼引用方式採起下面給出的代碼:code

android:icon="@mipmap/ic_launcher"
相關文章
相關標籤/搜索