网上关于ListView的左右列表并排挺多,但是现在基本上都没用ListView 了,今天来写写RecycleView左右列表并排。
页面布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/left_list" android:layout_width="90dp" android:layout_height="match_parent" android:background="@color/white" android:scrollbars="none" /> <android.support.v7.widget.RecyclerView android:id="@+id/right_list" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="none" /> </LinearLayout>ok,接下来看leftAdapter
public class MostLeftAdapter extends RecyclerView.Adapter { private Context mContext; private List<String> mList = new ArrayList<>(); private MyItemClickListener