0

我想创建一个滑动来刷新布局,但是这个异常被提出了。异常详细信息记录在 Window > Show View > Error Log 找不到以下类: - android.support.v4.widget.SwipeRefreshLayout(修复构建路径,编辑 XML,创建类)

<?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 在您的所有项目中都不相同。只做一件事,使所有 support-v4 相同(从一个复制到其他项目)

=== 更新 ===

你的依赖库一定有问题。分享更多细节,以便我们调查。

这是用于滑动刷新布局的 Google 官方示例:

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

你可以参考这个。

于 2014-12-10T09:40:46.690 回答