Search code examples
androidnavbartextcolor

Change text color in navigation bar Android Studio with getSupportActionBar()


is there an option to programatically change the navigation bar text color in Android Studio? I have changed the background color successfully in one line but I cannot change the text color. Sorry, very beginning at Android Studio :)

here's how I changed the background color:

 getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#C0FA94")));

Solution

  • you can use this code to set color and text to Action bar :

    getSupportActionBar().setTitle(Html.fromHtml("<font color='#ff0000'>ActionBar title </font>"));
    

    color mod is RGB .