Actionbar Logo size?

拥有回忆 提交于 2019-11-29 20:18:31

I looked into the resources of the YouTube app, since that seems to be the only official Google app (besides I/O) that uses an action bar logo at the moment.

It contains three drawables for the logo:

  • drawable-mdpi/ic_logo_wide.png (75 x 32 px)
  • drawable-hdpi/ic_logo_wide.png (112 x 48 px)
  • drawable-xhdpi/ic_logo_wide.png (149 x 64 px)

According to Iconography from the Android design guidelines, those images' heights match the specification for the action bar icons, which is 32 x 32 dp.

  • 32 dp = 32 px (MDPI)
  • 32 dp * 1.5 = 48 px (HDPI)
  • 32 dp * 2 = 64 px (XHDPI)

You'll notice that the 72 px (XHDPI) from the I/O app don't show up. I guess, they just wanted to increase the logo's height a bit.

If a drawable is only provided in XHDPI, Android scales it down, which is a little less performant than providing the images in the proper sizes. I guess, this was just accepted by the developers of the I/O app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!