2

我正在使用 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);
        }
    });
4

1 回答 1

0

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

于 2014-11-07T06:07:42.870 回答