Domanda

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

È stato utile?

Soluzione 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.

Altri suggerimenti

You can checkout the shadow drawable in Google IO 2014 App

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top