0

レイアウトを更新するスワイプを作成したいのですが、この例外が発生します。例外の詳細は Window > Show View > Error Log に記録されます The following classes could not be found: - android.support.v4.widget.SwipeRefreshLayout (Fix Build Path, Edit XML, Create Class)

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

    <ScrollView android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView android:text="swipe"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:gravity="center"/>

    </ScrollView>

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

1 に答える 1

0

===更新===

すべてのプロジェクトで support-v4 が同一ではないようです。1 つのことだけを行い、すべての support-v4 を同じにします (1 つのプロジェクトから他のプロジェクトにコピーします)。

===更新===

依存関係のライブラリに何か問題があるに違いありません。調査できるように、詳細を共有してください。

これは、スワイプしてレイアウトを更新するための Google 公式サンプルです。

https://github.com/googlesamples/android-SwipeRefreshListFragment

これを参照できます。

于 2014-12-10T09:40:46.690 に答える