【发布时间】:2014-12-22 10:27:52
【问题描述】:
我正在使用支持库 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>
这段代码运行良好。
视频:Example
<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>
事实并非如此。
视频:Example
是否可以在 SwipeRefreshLayout 中处理不可滚动的内容?
【问题讨论】:
-
是的,这是可能的。你到底遇到了什么麻烦?
-
加载器出现片刻后立即消失
-
而且这个进度条(加载器)并没有从顶部移动,只是出现一瞬间然后消失
标签: android android-support-library swiperefreshlayout