Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android transparent ActionBar with ActionSherlock on v19

I changed the AndroidManifest from

android:targetSdkVersion="18"

to

android:targetSdkVersion="19"

Now i have a issue with my transparent actionbar using a png

this i the actionbar layout i want to, on a N4 with v18:

v18 nice actionbar

and this is the actionbar on v19 on the n5, there is a "little" transparency, but not full:

v19, bad actionbar

This is my theme setup in values/styles.xml:

<style name="MyTheme" parent="Theme.Sherlock.Light">
    <item name="windowActionBarOverlay">true</item>

    <!-- Actionbar Background -->
    <item name="actionBarStyle">@style/My.Actionbar</item>
</style>
<style name="My.Actionbar" parent="Widget.Sherlock.Light.ActionBar.Solid">
    <item name="background">@drawable/actionbarbg</item>
    <item name="android:background">@drawable/actionbarbg</item>
</style>

and this in the values-v19/styles.xml

 <style name="MyTheme" parent="Theme.Sherlock.Light">
      <item name="actionBarStyle">@style/My.Actionbar</item>
      <item name="android:actionBarStyle">@style/My.Actionbar</item>
      <item name="windowActionBarOverlay">true</item>
      <item name="android:windowActionBarOverlay">true</item>
</style>

<style name="My.Actionbar" parent="Widget.Sherlock.Light.ActionBar.Solid">
    <item name="android:background">@drawable/actionbarbg</item>
</style>

If i change back the targetSdk to 18, it also works on the Nexus5

Any Idea whats my mistake?

like image 286
develth Avatar asked Nov 08 '13 17:11

develth


1 Answers

The issue you are seeing is that there is a drop shadow that normally sits below the action bar. You can remove it by adding

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

to the styles for your apptheme in the values-v19 folder.

Source: this answer

like image 168
anthonycr Avatar answered Oct 20 '22 10:10

anthonycr