我正在使用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);
}
});
答案 0 :(得分:0)
SwipeRefershLayout
不支持pull from bottom
。你需要为此实现自己的。看看这个lib是否有帮助。 https://bitbucket.org/andreyice/swiperefreshlayoutbottom。我没用过它。或者只是查看代码并尝试通过扩展它们来添加自己的功能:)