按 100% 半径布局的阴影

shadow to layout by 100% radius

我想为布局添加阴影,如下图所示:

http://s9.picofile.com/file/8321463292/android.png

我不想使用 android:elevation,因为不适用于 android 4.3

此外,我使用了这些库,但对我来说并不正确:

https://github.com/loopeer/shadow
https://github.com/dmytrodanylyk/shadow-layout
https://github.com/Devlight/ShadowLayout
https://github.com/harjot-oberai/MaterialShadows
https://github.com/xuehuayous/Android-ShadowView

我如何为像顶部图片这样的布局设置阴影? (平滑、100% 半径和彩色)

谢谢

根据您的要求,我有两个制作阴影的建议

you can use 9-patch image, may be this link will help you to create 9-patch with shadow

备用

solution is to make gradient and set background to your button view.