Skip to content Skip to sidebar Skip to footer

How Can I Change The Style Of Action Bar Api 15

I want to change the style of my Action bar so I want to change the color of line under the action bar from Blue to Orange , how can I do that?

Solution 1:

There is a good tutorial here

Create a new style with your custom drawable

<?xml version="1.0" encoding="utf-8"?><resources><!-- the theme applied to the application or activity --><stylename="Theme.MyStyle"parent="@android:style/Theme.Holo"><itemname="android:actionBarStyle">@style/MyActionBar</item><!-- other activity and action bar styles here --></style><!-- style for the action bar backgrounds --><stylename="MyActionBar"parent="@android:style/Widget.Holo.ActionBar"><itemname="android:background">@drawable/ab_background</item><itemname="android:backgroundStacked">@drawable/ab_background</item><itemname="android:backgroundSplit">@drawable/ab_split_background</item></style></resources>

then in AndroidManifest.xml add the custom style

<applicationandroid:debuggable="true"android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/Theme.MyStyle"
        ><activity...><activity.../>
   ...

</application>

Solution 2:

If you want change it by code, you could try this:

getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.myninepatch));

Post a Comment for "How Can I Change The Style Of Action Bar Api 15"