我试图按照这篇文章实施SwipeRefreshLayout:http://nlopez.io/swiperefreshlayout-with-listview-done-right/
所以现在我的XML看起来像这样:
<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">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/match_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#999999"
android:dividerHeight="2dp"
android:gravity="center_horizontal"
android:listSelector="@android:color/transparent">
</ListView>
<include
android:id="@+id/empty"
layout="@layout/empty_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
调试我的应用时出现此错误:
android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v4.widget.SwipeRefreshLayout
当我在片段onCreateView上找到这一行:
View view = inflater.inflate(matchType.getLayout(), container, false);
我的SDK管理器会报告所有内容都应该更新,以便我真的在智慧结束......
请帮忙......
提前致谢