Action Bar icon size

前端 未结 5 1512
醉梦人生
醉梦人生 2020-12-01 03:24

According to Action Bar Icons action bar icon for the mdpi screen should be 24 x 24 px but the icons in Action Bar Icon Pack for mdpi are 32 x 32 px. The sizes do not match

相关标签:
5条回答
  • 2020-12-01 03:52

    Use Android Studio Image Asset

    Go to:

    1. Project>res --> right click
    2. new> image asset --> Icon type: Action Bar and Tab Icons
    3. next>Finish.

    Now you will have your icon in the correct resolutions.

    0 讨论(0)
  • 2020-12-01 03:55

    UPDATE: this answer is no longer valid, see the below answer for more up-to-date guidelines.

    I believe they have to be 32x32dp, but the actual image itself should be 24dpx24dp centred. The Android design website has the correct guidelines.

    I've submitted a bug report about this but have yet to hear anything...

    0 讨论(0)
  • 2020-12-01 04:01

    -------update 2015.10.17--------

    The new google design gideline says:"System icons are displayed at 24dp","Icon content is limited to the 20 x 20dp live area, with 4px of trim around the perimeter".Like:

    ------old-------

    Full asset, 32x32 dp; Optical square, 24x24 dp

    enter image description here

    0 讨论(0)
  • 2020-12-01 04:04

    The finished action bar icon dimensions as shown in the link below should be. https://developer.android.com/guide/practices/ui_guidelines/icon_design_action_bar.html

    Low density screen

    ldpi (120 dpi) --> 18 x 18 px
    

    Medium density screen

    mdpi (160 dpi) --> 24 x 24 px
    

    High density screen

    hdpi (240 dpi) --> 36 x 36 px
    

    Extra-high density screen

    xhdpi (320 dpi) --> 48 x 48 px  
    

    XX-high density screen

    xxhdpi (480 dpi) --> 72 x 72 px
    

    XXX-high density screen

    xxxhdpi (640 dpi) --> 96 x 96 px
    
    0 讨论(0)
  • 2020-12-01 04:05

    I've conducted more testing with AppCompat ActionBar. I found out, that the ActionBar takes care for itself to enforce the minimum 48dp touch target size. I also found out, that the AppCompat ActionBar still expects action bar icons with a 32dp square size.

    Even with Material design, icons still have to follow rule "Full asset: 32x32 dp; Optical square: 24x24 dp" to have the correct size along with other icons in the action bar as this figure (from wangqi060934's anwer) shows:

    My previous assumption (see figures below) that the full asset size expanded from 32dp to 48dp is not correct. The 48dp are talking about the touch area. The confusion was caused by the revised Material Icon Spec document which is linked in the much older ActionBar document.

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

    from http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-sizing-by-increments

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