【问题标题】:how can i use SwipereFreshLayout on bottom in gridview?如何在 gridview 的底部使用 SwipereFreshLayout?
【发布时间】:2014-11-07 05:40:13
【问题描述】:

我正在使用 SwipereFreshLayout,它总是出现在网格视图的顶部,但我想把它放在底部。我该怎么做?

 <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:
        android:layout_height="match_parent" >

        <GridView
            android:id="@+id/private_board"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@+id/bottom_progress_bar"
            android:layout_marginTop="5dp"
            android:background="#F4F4F4"
            android:horizontalSpacing="10dp"
            android:numColumns="2"
            android:padding="14dp"
            android:verticalSpacing="10dp" />
    </android.support.v4.widget.SwipeRefreshLayout>

代码:

    swipeLayout.setColorScheme(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light,
                android.R.color.holo_orange_light,
                android.R.color.holo_red_light);

       swipeLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {

             new Handler().postDelayed(new Runnable() {
                    @Override public void run() {
                        swipeLayout.setRefreshing(true);
                    }
                }, 2000);
        }
    });

【问题讨论】:

  • 你的意思是在底部使用??
  • 它的意思是在gridview的末尾..swiperefreshlayout总是显示在顶部,但我想显示在底部。
  • swipeRefreshLayout 是一个容器,GridLayout 是存在于swipeRefreshLayout 中的内容。当swipeRefreshLayout 只是一个容器时,我知道它是如何出现在顶部的:-/
  • 是的,先生,我知道,但 swiperefreshlayout 在顶部工作,但我想在底部做同样的工作。

标签: android swiperefreshlayout


【解决方案1】:

SwipeRefershLayout 不支持pull from bottom。您需要为此实现自己的。如果有帮助,请查看此库。 https://bitbucket.org/andreyice/swiperefreshlayoutbottom。我没用过。或者只是查看代码并尝试通过扩展它们来添加您自己的功能:)

【讨论】:

    猜你喜欢
    • 2014-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-20
    相关资源
    最近更新 更多