<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="wrap_content" />
</RelativeLayout>
以上是xml里面的代码
下面是activity里面要加的属性
recyclerview.setHasFixedSize(true);// --'if (Build.VERSION. SDK_INT > Build.VERSION_CODES. KITKAT_WATCH) {
recyclerview.setNestedScrollingEnabled(false);}