13

RecyclerViewの唯一の子として があり、SwipeRefreshLayoutRecyclerView が必要ですwrap_content。それらの両方を「wrap_content」に設定すると、機能しません。品数RecyclerViewも少ないmatch_parentです。私が削除するSwipeRefreshLayoutと、RecyclerView意志wrap_content。誰でも私を助けることができますか?私の英語は下手です、多分あなたは理解できないでしょう。誰でも私を助けることができますか?どうもありがとうございました。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container_v"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#00ffff">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ff00ff">

    </android.support.v7.widget.RecyclerView>

</android.support.v4.widget.SwipeRefreshLayout>
4

2 に答える 2

16

最後に、私はそれを解決します。この回答から

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container_v"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#00ffff">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"/>

        </LinearLayout>
    </android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
于 2016-12-03T07:34:51.440 に答える