简体   繁体   English

Android Actionbar图标可绘制

[英]Android Actionbar Icon Drawable

As you probably know, there are some icons on Github from Google to use. 您可能知道,Google的Github上有一些图标可供使用。 I wanted to implement a actionbar icon and saw this here(google.com/design) and this(dev.android.com) . 我想实现一个动作栏图标,并在此处(google.com/design)this(dev.android.com)看到了。

  • google.com/design tells me to use a 24dp icon google.com/design告诉我使用24dp图标
  • dev.android.com sais I should use a 32dp icon dev.android.com说我应该使用32dp图标

I myself implemented the 24dp one since it had a 24dp icon in the provided icons of Google. 我自己实现了24dp,因为它在Google提供的图标中有一个24dp图标。 I put the icon in every folder by hand including xxxhdpi, xxhdpi, xhdpi, hdpi, mdpi but as you can see below the list-icon should be bigger as it is right now. 我将图标手动放置在每个文件夹中,包括xxxhdpi,xxhdpi,xhdpi,hdpi,mdpi,但是如您所见,列表图标现在应该更大。 (the list-icon ist the one below the battery icon) (列表图标位于电池图标下方的一个)

So I checked out IO Schedule and there they have a 96px x 96px icon in a xxhdpi folder which totally confused me. 所以我签出了IO Schedule ,在xxhdpi文件夹中有一个96px x 96px的图标,这完全让我感到困惑。

  1. which information is true? 哪些信息是真实的? How should I implement my Icons? 我应该如何实现我的图标? What's best practice? 最佳做法是什么?
  2. Any advice on automate all the icon versions? 关于自动化所有图标版本的任何建议? thanks 谢谢

24dp列表图标

Use 24dp icons. 使用24dp图标。 This will give you following real image sizes: 这将为您提供以下实际图像尺寸:

  • mdpi icons are 24x24 (base) mdpi图标为24x24(基本)
  • hdpi icons are 36x36 (1,5x base) hdpi图标为36x36(1.5x基本)
  • xhdpi icons are 48x48 (2x base) xhdpi图标为48x48(基本像素为2x)
  • xxhdpi icons are 72x72 (3x base) xxhdpi图标为72x72(基本像素为3x)
  • xxxhdpi icons are 96x96 (4x base) xxxhdpi图标为96x96(基本分辨率为4x)

In correct folders these will produce a 24dp image on appropriate screens. 在正确的文件夹中,这些将在适当的屏幕上产生24dp图像。

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

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