2

I'm not able to set the transparency or any other color to the Actionbar. My style.xml:

<style name="thin_actionbar" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/thin_actionbar_style</item>

</style>
<style name="thin_actionbar_style" parent="android:Widget.Holo.ActionBar">
    <item name="android:height">60dp</item>
    <item name="android:homeAsUpIndicator">@drawable/ic_drawer</item>
    <item name="android:background">@color/translucent_control</item>
</style>

tranlucent_color: like the bar in the screenshot below. Looks like this. It's just grey:

enter image description here

Please help me!

diiiz_
  • 607
  • 1
  • 6
  • 19

2 Answers2

3

try this code

<item name="android:background">@null</item>

If this does'nt helps you, Check this link with this Code

Call setStackedBackgroundDrawable() on your ActionBar

getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); ActionBar actionBar = getActionBar(); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#330000ff"))); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#550000ff")));

OR this link , this code

<style name="MyTheme" parent="Theme.Sherlock"> ... <item name="windowActionBarOverlay">true</item> <!-- for ActionBarSherlock --> <item name="android:windowActionBarOverlay">true</item> </style>

For making ActionBar Transparent.Hope this helps.

Community
  • 1
  • 1
i.n.e.f
  • 1,773
  • 13
  • 22
  • 1
    Thanks! That worked. I think the `getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);` did it. But now I can see the Navigation Drawer underneath the Actionbar. Is there a way to remove the part of the Drawer under the bar? – diiiz_ Mar 12 '14 at 15:52
0

for back ground you can use :

 <item name="android:background">@android:color/transparent</item>

i hope it will help

Yogendra
  • 4,817
  • 1
  • 28
  • 21