Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Any way to add a drop shadow to a view?

I know it's easy to do in CSS. Is there any property you can use when creating a view to add a drop shadow to it?

— asked June 4th 2010 by Bill Labus
  • drop
  • shadow
  • view
0 Comments

9 Answers

  • Yeah, I need something nicer looking than that (i.e. with a blurred edge). Guess I'll just have to use images. I would think that'd be a good property for Titanium to support, since it's a fairly standard element in user interface design.

    — answered June 4th 2010 by Bill Labus
    permalink
    0 Comments
  • If you need blurred effects I would recommend experimenting with gradient views. You can get some nice effects if you use multiple views creatively :-)

    Don't be surprised to come across bugs though when you layer multiple views and when you use gradients in some of them. I hit one of those with dashboard views where using gradients in one of the lower layers would completely cover the ui for the elements in higher level views (while still allowing the event detection).

    — answered June 4th 2010 by Kyle Quest
    permalink
    0 Comments
  • There's a good answer here for labels (via Jeff's demo), but for views you would need to use two views of the same size, and offset one relative to the other. Here's a snippet you can drop into an app.js to see in action:

    http://gist.github.com/425669

    — answered June 4th 2010 by Kevin Whinnery
    permalink
    0 Comments
  • You could use background image on the second view if the shadow effect isn't nice enough with views (based on my example).

    — answered June 4th 2010 by Kevin Whinnery
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.