2

I applied a gradient background to my ActionBar. I can see it in the preview on Eclipse but when I run the app on my phone, the action bar vanishes completely. Why is this happening?

styles.xml

<resources>

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

    <style name="AppTheme.ActionBarStyle" parent="android:Theme.Holo.Light">
        <item name="android:background">@drawable/bg_actionbar</item>
    </style>

</resources>
W.K.S
  • 9,787
  • 15
  • 75
  • 122

1 Answers1

1

try use to:

Drawable d=getResources().getDrawable(R.drawable.background_image_name);  
getActionBar().setBackgroundDrawable(d);

and see this question link

Community
  • 1
  • 1
Ozik Abdullaev
  • 1,026
  • 1
  • 9
  • 26