Elevation not working for ImageView

后端 未结 8 678
后悔当初
后悔当初 2020-12-28 13:26

Elevation for ImageView is not working. I declared ImageView in XML like this:



        
相关标签:
8条回答
  • 2020-12-28 14:11

    As an addition to the clarification of BladeCoder's answer: applying android:outlineProvider="bounds" to the ImageView will result in the shadow to be displayed.

    0 讨论(0)
  • 2020-12-28 14:13

    The elevation shadow is derived from the background drawable of a View. If your ImageView has no background, you'll see no shadow.

    If you want to change that behavior, you need to build your own ViewOutlineProvider and call View.setOutlineProvider() to set it (and this is not trivial).

    0 讨论(0)
提交回复
热议问题