Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 水平循环视图,当前项目已缩放,下一个项目显示一点_Android_Xml_Android Recyclerview - Fatal编程技术网

Android 水平循环视图,当前项目已缩放,下一个项目显示一点

Android 水平循环视图,当前项目已缩放,下一个项目显示一点,android,xml,android-recyclerview,Android,Xml,Android Recyclerview,我正在尝试制作一个水平的回收视图,如图中的,左边的截图 我设法做了水平部分,但下一张和预览卡没有显示 这是xml回收视图 <android.support.v7.widget.RecyclerView android:id="@+id/rv_cards" android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false"

我正在尝试制作一个水平的回收视图,如图中的,左边的截图

我设法做了水平部分,但下一张和预览卡没有显示

这是xml回收视图

<android.support.v7.widget.RecyclerView
    android:id="@+id/rv_cards"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipToPadding="false"
    android:orientation="horizontal"
    android:requiresFadingEdge="horizontal"
    app:layoutManager="android.support.v7.widget.LinearLayoutManager"
    tools:listitem="@layout/recyclerview_card_row" />
  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
android:padding="10dp">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/rounded_qicard_accent"
    android:elevation="5dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@drawable/qicard_card"
        android:gravity="bottom"
        android:layoutDirection="ltr"
        android:orientation="vertical"
        android:padding="10dp">

        <TextView
            android:id="@+id/tv_card_number"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_marginBottom="5dp"
            android:layout_marginTop="5dp"
            android:background="@null"
            android:gravity="center"
            android:hint="* * * *  * * * *  * * * *  6968"
            android:textSize="20sp" />
    </LinearLayout>
</LinearLayout>
    rv_cards = (RecyclerView) findViewById(R.id.rv_cards);
    rv_cards.setHasFixedSize(true);
    rv_cards.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));

    SnapHelper snapHelper = new LinearSnapHelper();
    snapHelper.attachToRecyclerView(rv_cards);