Change color of Navigation Drawer Icon in Android Studio default template

前端 未结 9 988
北恋
北恋 2020-12-13 05:52

The new default Navigation Drawer Activity template in Android Studio

defines its titles and icons in a menu file activity_main_drawer like thi

9条回答
  •  暖寄归人
    2020-12-13 06:28

    If you want to set it dynamically you can use:

    ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open_drawer, R.string.close_drawer);
    
    actionBarDrawerToggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.colorAccent));
    

提交回复
热议问题