Changing CardView shadow color

前端 未结 5 660
孤独总比滥情好
孤独总比滥情好 2020-12-23 17:44

This question was asked on SO many times, but still I didn\'t find a good solution for this problem.

Why do I need this to do? Well because project me and my team de

5条回答
  •  感情败类
    2020-12-23 18:29

    Consider this thread in twitter, where Nick Butcher talks about how to implement the feature:

    See outlineAmbientShadowColor, outlineSpotShadowColor, spotShadowAlpha and ambientShadowAlpha attributes for details. Unfortunately, that's possible from API 28 onwards.

    For lower APIs Nick has shared a gist. Here's the result:

    Running on API 21

    This technique isn't directly connected to CardView, it can be applied to any View.

提交回复
热议问题