最近项目中用到了RecyclerView,在此记录一下(界面中也存在其他交互控件),例如下面这张图:图片上方是五个TextView,垂直排列,下方是一个用于展示的RecyclerView,为了解决ScrollView与RecyclerView的滑动冲突,将RecyclerView的滑动交给Scrollview来完成,需要如下代码:
首先是.xml文件中:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text