Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove notification bar shadow in android app

In android, the notification bar at the top has a shadow most of the time. However, sometimes, such as when an app has it's title-bar showing, or in some other cases (such as in the twitter app or the market) that shadow effect is gone. My guess is that the shadow is supposed to be there when the content underneath can scroll.

In my app, however, the content underneath can't scroll, and I think the shadow looks bad on the top part of my logo.

Does anyone know how to disable it?

like image 254
defrex Avatar asked Jun 06 '10 13:06

defrex


1 Answers

<!-- Variation on the Light theme that turns off the title -->
<style name="Theme.IOSched" parent="android:style/Theme.Light">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

The android:windowContentOverlay is your shadow, and setting it to @null in your theme will eliminate it. You can see this in action in the Google I|O 2010 conference app, which uses many of the same UI conventions as does the new Twitter app. However, right now, the Twitter app has not yet been open-sourced, which is why I point you to the I|O app. The code fragment above is from that app's styles.xml resource.

like image 61
CommonsWare Avatar answered Nov 01 '22 11:11

CommonsWare