Align an icon with the Toolbar icon - Android Material Design

前端 未结 1 2160
别那么骄傲
别那么骄傲 2021-02-14 13:02

In the new Material Design (using AppCompat), I am trying to align some action icons with the drawer icon of the new toolbar. Something like:

相关标签:
1条回答
  • 2021-02-14 13:31

    The problem is that I can't perfectly align it, because after that left padding of 16px, the icons should start, but the icon itself has also some "padding" (icon from material github)

    Yes, the icon must have some padding and it varies depending on which screen resolution the icon will be displayed. The padding for different screen density:
    mdpi        4px * 1.0 = 4px
    hdpi         4px * 1.5 = 6px
    xhdpi       4px * 2.0 = 8px
    xxhdpi     4px * 3.0 = 12px
    xxxhdpi   4px * 4.0 = 16px
    This is the padding included in the icon drawable and you shouldn't remove it. icon live area

    enter image description here

    http://www.google.com/design/spec/style/icons.html#icons-system-icons

    0 讨论(0)
提交回复
热议问题