最近做項目用到了新控件CardView否彩,結(jié)果發(fā)現(xiàn)安卓4.4的情況下出現(xiàn)這樣的情況
image.png
很明顯的坑爹舒帮,,末秃,概页,
后來查找資料發(fā)現(xiàn),在CardView添加以下屬性代碼即可(app:cardPreventCornerOverlap="false"):
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24px"
android:layout_marginRight="24px"
android:elevation="6px"
app:cardCornerRadius="10px"
app:cardPreventCornerOverlap="false">
然而更坑爹的來了练慕,背景的藍(lán)色尖角居然把cardview的圓角給擋住了惰匙。。铃将。项鬼。。
沒辦法劲阎,只能把藍(lán)色背景的樣式加上圓角
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="0"
android:endColor="#32b4ff"
android:startColor="#32ccff" />
<corners
android:bottomLeftRadius="10px"
android:topLeftRadius="10px" />
</shape>