方法一: LayoutInflater.from(context).inflate(R.layout.item_check_problem_feedback, null)改为
LayoutInflater.from(context).inflate(R.layout.item_check_problem_feedback, parent,false)
方法二:
使用recycleview的时候,item里面的布局在预览界面没问题,但是实际运行结果很糟糕,我用的是linearlayoutmanager,原来布局中最外围的linearlayout不能只包含一个子布局
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<内容>
</LinearLayout>
</LinearLayout>
改成
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">
<内容>
</LinearLayout>