【发布时间】: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