Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Honeycomb ActionBar Title Shadow

How can I add shadow under the title text?

The following xml doesn't do the trick.

<style name="Theme" parent="android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/ActionBar</item>
    <item name="android:windowBackground">@drawable/background</item>
</style>

<style name="ActionBar" parent="android:style/Widget.Holo.ActionBar">
    <item name="android:background">@drawable/action_bar</item>
    <item name="android:titleTextStyle">@style/TitleTextStyle</item>
</style>

<style name="TitleTextStyle" parent="android:style/TextAppearance.Large">
    <item name="android:textColor">@color/title_text_color</item>
    <item name="android:textStyle">bold</item>
    <item name="android:shadowColor">@color/title_shadow_color</item>
    <item name="android:shadowDx">0</item>
    <item name="android:shadowDy">0</item>
    <item name="android:shadowRadius">1</item>
</style>
like image 801
Tughi Avatar asked Sep 29 '11 09:09

Tughi


2 Answers

Adding a shadow under the title of the (native) ActionBar works starting with API Level 18 (Android Jelly Bean 4.3). Works fine in API Level 19 (Android KitKat 4.4).

See my answer for XML code and a screenshot.

like image 109
Alex Vang Avatar answered Sep 21 '22 06:09

Alex Vang


It's there, you just don't see it. You need to displace the shadow using either (or both) shadowDx or shadowDy

(wow, quite an old question, how come no answers except the totally relevant comment by @James)

like image 42
Ivan Bartsov Avatar answered Sep 22 '22 06:09

Ivan Bartsov