Android 如何实现RecyclerView横向滑动
代码可以分为几个模块,适配器,ViewHolder,布局,item 布局,Activity中设置横行滑动
布局如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- user list-->
<LinearLayout
android:layout_marginTop="7dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout
android:gravity="center_vertical"
android:padding="3dp"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_shape">
<co