views:

586

answers:

1

Hi all,

I would like to ask you if is possible to add a shadow to each item in a gallery. And if is possible, what is the easiest way to do it?

Thanks in advance!

A: 

It depends on what type of view you are adding to the Gallery. For example, if it's a TextView, you can use android:shadowColor, android:shadowDx, android:shadowDy, and android:shadowRadius to specify the shadow.

If you provide your layout XML that you're using in the Gallery adapter, and explain what you want the shadow to be attached to, it would help give a more clear answer.

Joe
Thanks for your answer. The content of the Gallery are images, using ImageView. I would like to attach an screenshot, but I don't have enough points :(
Antonio
Looks like you would need to extend `ImageView`'s `onDraw()` method, and use Paint.setShadowLayer(). See:http://developer.android.com/intl/zh-CN/reference/android/graphics/Paint.html#setShadowLayer%28float,%20float,%20float,%20int%29
Joe
@joe can you provide an example
coneybeare