Android - Standard height of toolbar

后端 未结 6 1577
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 15:59

I want to create a toolbar in my app, and I am wondering what is the standard height for the toolbar in android?

I want it to be big enough for a finger, but not huge.

6条回答
  •  死守一世寂寞
    2021-01-30 16:26

    In addition to @vedant1811 answer, you can programmatically obtain actionBarSize from attrs:

    TypedValue tv = new TypedValue();
    if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
    {
        actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
    }
    

提交回复
热议问题