How to change color of Toolbar back button in Android?

后端 未结 17 1157
不知归路
不知归路 2020-12-04 06:51

I could not change the color of back button. I am using toolbar material design. In my app I am applying black background of tool bar but the back design is being black by d

17条回答
  •  生来不讨喜
    2020-12-04 07:16

    If you want system back color in white then you can use this code

    
    
            
    
                
            
        
    

    Note:- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" is key

    The paste is in your activity where you want to show back button on action bar

    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_notification);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(false);
    

提交回复
热议问题