I am having a hard time with v7 Toolbar. What was once a simple task for ActionBar
, now seems overly complex. No matter what style I set, I cannot change either
if you want to change your icons to a Vector , create a new one.
and then in your Activity.java
:
Toolbar toolbar = findViewById(R.id.your_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationIcon(R.drawable.your_icon);
mToolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.your_icon2));
To change Vector icon Color, go to your Vector XML file.. in this case it will be your_icon.xml
, it will look like this :
Note that we used these attributes to set the Vector's color :
android:fillColor="@color/Your_Color"
Edit : You can't use a color from your colors.XML or somewhere else , the color must be decalred directly in the Vector's XML file.. so it will look like this :
android:fillColor="#FFF"