我正在尝试按照这篇文章实施 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 管理器报告说一切都应该更新,所以我真的束手无策......
请帮忙...
提前致谢