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?
Asked
Active
Viewed 1,376 times
0

StarsSky
- 6,721
- 6
- 38
- 63

Mohammed Subhi Sheikh Quroush
- 5,801
- 18
- 57
- 95
-
refer this http://android-developers.blogspot.in/2011/04/customizing-action-bar.html – Dixit Patel Jan 29 '13 at 18:28
2 Answers
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 -->
<style name="Theme.MyStyle" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!-- other activity and action bar styles here -->
</style>
<!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/ab_background</item>
<item name="android:backgroundStacked">@drawable/ab_background</item>
<item name="android:backgroundSplit">@drawable/ab_split_background</item>
</style>
</resources>
then in AndroidManifest.xml add the custom style
<application
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.MyStyle"
>
<activity ...>
<activity .../>
...
</application>

StarsSky
- 6,721
- 6
- 38
- 63
-
I want to change the color of the line under action bar not thee background of action bar – Mohammed Subhi Sheikh Quroush Jan 29 '13 at 20:55
0
If you want change it by code, you could try this:
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.myninepatch));

karabara
- 547
- 6
- 24