解决前的那个“添加数据项”的黑边框是由于引入xml文件的时候使用错了方法。

改正如下:

(错误)private View mHeader  =    Global.inflate(R.layout.body_data_header);

(正确)private View mHeader  =   LayoutInflater.from(this).inflate(R.layout.body_data_header,null);

这样就不会出现黑色的边框了。


最终CardView属性设置如下:

 <android.support.v7.widget.CardView
        android:id="@+id/content_cv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="12dp"
        android:layout_marginTop="12dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        app:cardBackgroundColor="@color/white"
        app:cardCornerRadius="10dp"
        app:cardElevation="10dp"
        >


解决前:

Android recycleview和cardview结合使用出现的边角阴影问题


解决后:


Android recycleview和cardview结合使用出现的边角阴影问题

相关文章:

  • 2022-12-23
  • 2021-05-26
  • 2021-07-13
  • 2021-12-26
  • 2021-11-20
  • 2021-12-14
  • 2021-09-25
  • 2021-09-25
猜你喜欢
  • 2021-04-28
  • 2021-04-27
  • 2021-09-01
  • 2022-12-23
  • 1970-01-01
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案