Question

Is there a way to add a drop shadow to a FrameLayout programmatically without the use of an additional XML file?

If yes please can you provide me a solution?

Something like that:

enter image description here

Était-ce utile?

La solution 2

I fixed my problem by creating a gradient color on Photoshop, then creating views that has this color as background. On transitions, I change the X,Y,width,height properly :)

Edit 2019:

The simple solution now is add some elevation to the FrameLayout.

Autres conseils

You can checkout the shadow drawable in Google IO 2014 App

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top