2

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!

Antonio
  • 3,128
  • 2
  • 22
  • 14

2 Answers2

2

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
  • 42,036
  • 13
  • 45
  • 61
  • 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 Apr 15 '10 at 07:23
  • 1
    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 Apr 20 '10 at 21:33
0

Here you go if you are still looking for it: Custom ImageView with drop shadow

Community
  • 1
  • 1
dcool
  • 4,039
  • 3
  • 16
  • 14