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=" http://schemas.android.com/apk/res/android" ;
        android:shape="rectangle">
        <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" />
</shape>


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>
        </style>


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?
Thanks!
Natalie

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(ViewRoot.java:447)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:239)
at android.app.Activity.showDialog(Activity.java:2488)
at com.alocaly.LetterGame.LetterGame$1.run(LetterGame.java:994)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4338)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
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,

Emmanuel
http://androidblogger.blogspot.com/
http://www.alocaly.com

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?