shape with shadow

by Benjamin » Wed, 16 Dec 2009 02:20:18 GMT

Sponsored Links
 Hey guys,

how can i add shadow to a shape?

My shape.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="" ;
        <gradient android:startColor="#272828" android:endColor="#272828"
                android:angle="90" />

        <padding android:left="0px" android:top="10px" android:right="0px"
                android:bottom="10px" />

        <corners android:bottomRightRadius="30px"
                android:bottomLeftRadius="30px" android:topLeftRadius="0.1dp"
                android:topRightRadius="0.1dp" />

I tried to add this shape as background to a linearlayout. After this
i added following style to the linearlayout:

<style name="shape_with_shadow">
                <item name="android:background">@drawable/shape</item>
                <item name="android:shadowColor">#ff00ff</item>
                <item name="android:shadowDx">1.2</item>
                <item name="android:shadowRadius">1.5</item>

But i don't se any shadow.  How can i fix that?

please help, thanks


Other Threads

1. Broadcast Receiver and Remote Service

Hi everyone,
I'm hoping to do some audio processing in a remote service (service
I've spawned onto its own thread); this will basically occur in a while
(1) loop - so constant processing.  Occasionally I want to provide
some information back to the activity that is bound to the service;
I'm doing this by sending a broadcast from the service, that is
received by a broadcast receiver on the activity, which then uses the
activity's service connection to call into the service and get the
information needed; at this point the broadcast receiver makes an
alert dialog presenting the information to the user.
If I stay in my while(1) loop after raising the broadcast, the action
in the broadcast receiver never seems to occur.  This is confusing to
me since the activity and service are in separate threads.  If I end
the loop after raising the broadcast, the desired behavior on the
activity side occurs, but of course this isn't acceptable since I need
to be doing constant processing.  Anyone have any suggestions of what
the probelm might be?

2. Any body have a clue with this bug : "Adding window failed" ?

Hi all,

I have a crash reporter for some time in my game "Word Prospector".

And one of the very last (THE last??) bug that still occurs, but very
rarely is this one :

Stack :
java.lang.RuntimeException: Adding window failed
at android.view.ViewRoot.setView(
at android.view.WindowManagerImpl.addView(
at android.view.WindowManagerImpl.addView(
at android.view.Window$LocalWindowManager.addView(
at com.alocaly.LetterGame.LetterGame$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)

As you can see, my game just call a showDialog function, and the
Android OS returns a 'Adding window failed' exception...

I suspect that I hit a limit somewhere, but I don't have any clue on
what is really wrong here...

Someone has already seen that ?

Thanks for any help,


3. Access telephony database table from content provider

4. iPhone to Android: Creating "good" Android Interfaces

5. RatingBar size issues on high-density screens (Droid, Nexus One)

6. Able to get bad star rating removed?

7. How to deal with BuiltInZoomControl with custom controls in android google map?