在没有ListView的情况下滑动以刷新布局

时间:2018-06-16 11:20:22

标签: android

我想刷新页面,但我没有像SELECT * FROM mtytable WHERE YearId <= 2 -- Or any other year you're passing listview这样的内容。我想向下滑动以刷新片段。还应该有一个动画。 是否可以使用“滑动刷新”模块而不使用任何recyclerview等等

感谢您的回复

2 个答案:

答案 0 :(得分:1)

是的,您也可以使用 LinearLayout,RelativeLayout 。有关详细信息,请参阅以下代码,

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipeRefreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        // Other child views
    </LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>

感谢。

答案 1 :(得分:-1)

是的,它不仅适用于listview / recycler视图。它可以包含scrollview或adapterview。请参阅此https://stackoverflow.com/a/10971722/4781390