Change Action Bar Color Android Studio Code Example


Example 1: how to change actionbar color in android programmatically

getSherlockActivity().getSupportActionBar().setBackgroundDrawable(new ColorDrawable(0xff00ACED)); mActionBar.setBackgroundDrawable(new ColorDrawable(0xff00DDED)); mActionBar.setDisplayShowTitleEnabled(false); mActionBar.setDisplayShowTitleEnabled(true);

Example 2: actionbar content color in android

getActionBar()/* or getSupportActionBar() */.setTitle(Html.fromHtml("<font color=\"red\">" + getString(R.string.app_name) + "</font>"));

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools