简体   繁体   中英

Drop shadow for FrameLayout programmatically

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:

在此处输入图片说明

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.

您可以在Google IO 2014 App 中查看 shadow drawable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM