我正在使用 Support Library v21 中的 SwipeRefreshLayout。它适用于 List 或 ScrollView 等可滚动内容,但不适用于静态布局:
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center"
android:text="Content"/>
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
这段代码运行良好。
视频:示例
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center"
android:text="Content"/>
</android.support.v4.widget.SwipeRefreshLayout>
事实并非如此。
视频:示例
是否可以在 SwipeRefreshLayout 中使用不可滚动的内容?