Padding between ActionBar's home icon and title

前端 未结 21 1688
名媛妹妹
名媛妹妹 2020-11-28 20:03

Does anybody know how to set padding between the ActionBar\'s home icon and the title?

21条回答
  •  时光说笑
    2020-11-28 20:42

    If you are using toolbar from AppCompat (android.support.v7.widget.Toolbar, >= revision 24, June 2016), the padding between the icon and the title can be changed with the following value :

      app:contentInsetStartWithNavigation="0dp"
    

    To improve my answer, you can use it on your toolbar directly inside your activity or you can create a new layout file for your toolbar. In this case, you just have to import your toolbar's @id using the include property on each needed views.

    
    
    

    You can then import your layout on your activity.xml

    
    

提交回复
热议问题