For HDPI
, XHDPI
, etc. what should be the ideal size of the launcher icon? Should I have to create 9-Patch
images for the icon to scale automatically, or would it be better to create separate icons?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
No need for third party tools when Android Studio can generate icons for us.
File
->New
->Image Asset
Then choose
Launcher Icons
as the Asset Type:Choose a High-res image for the Image file:
Next
->Finish
to generate iconsFinally update
android:icon
name field inAndroidManifest.xml
if required.Adaptive Icons
Starting with Android 8.0 there are adaptive icons, which are made up of two separate layers. Both layers are 108 x 108 dp.
(image adapted from Android documentation)
Sizes
If you are supporting versions below Android 8.0, you still need to include the legacy sizes (
48dp
). I marked the pixel sizes in red for each resolution below.Don't do it by hand
I suppose you could make all of those by hand if you want to, but I have to say that my days of doing that are over. The Android Studio 3.0 Asset Studio is quite good and will generate them all for you. All you have to do is supply a sufficiently large foreground and background image. (I used a 1024 x 1024 px image).
To open the Asset Studio go to File > New > Image Asset.
I had the same problem but then realized the arrangement of my icon graphic within the square allowed (512 x 512 in my case) was not maximized. So I rotated the image and was able to scale it up to fill the corners better. Then I right clicked on my
res
folder in my project in Android Studio, then chooseNew
thenImage Asset
, it took me through a wizard where I got to select my image file to use. Then if you check the box that says "Trim surrounding blank space", it makes sure all edges, that are able, touch the sides of your square. These steps got it much bigger than the original.Launch image and Slash image size for Google Play Store app submission
Required Launch Icon And Splash Image size
Well as @MartinVonMartinsgrün mentioned Now there is exists Better tools then assert generator in android studio
For application Icon ( Toolbar , ActionBar , DrawableLeft etc ) Use : http://romannurik.github.io/AndroidAssetStudio/icons-actionbar.html
For launcher (Application Icon ) Use : https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
But Here are some tricks and way to get the better resolution for icons and launcher icons.
Step 1 :
First go to the https://materialdesignicons.com and choose your icon . Or if you have your icon in good resolution then skip this step . Click the desired icon and click on "Advanced Export" it will open up a window like this below
Then click the "Icon" to generate icon (.png) . Well the trick is try to generate as large icon as possible for high resolution devices and the tools will handle it all for small devices but if you use small icon , while generating the icon for high end devices you will loose the icon resolution .
Step 2 :
Then go the Tools page and Upload the Icon
Click the "Custom" if you want to color your icon . No matter what color of icon you are uploading , by using Custom you can generate any color you want . Then choose a name and click "Download .ZIP" . This will download the .zip file with the icon for most of the common resolution . You can copy and paste the res folder in your application project folder and you will see the icon in the drawable section .
Provide at least an 512px X 512px image and use this tool: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
It will generate all icons for you in the correct size, inclusive the web image for the play store.