且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带有圆角的Android CardView显示灰色角

更新时间:2023-01-26 20:27:25

由于阴影,您需要在cardview中留出空间以显示完整的阴影.将android:layout_margin="5dp"添加到 CardView ,您将看到灰色"颜色是阴影.

It is because of shadow, you need to give space to cardview to show full shadow. Add android:layout_margin="5dp" to CardView and you will see that the "grey" color is cut shadow.

解决方案正在向CardView添加app:cardUseCompatPadding="true",它将提供所需的间距.

Solution is adding app:cardUseCompatPadding="true" to CardView and it will give needed spacing.