如何在Android中的gridView的滚动侦听器上使按钮可见/消失 [英] How to make a Button Visible/Gone on scroll listener of gridView in Android
本文介绍了如何在Android中的gridView的滚动侦听器上使按钮可见/消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在框架布局中有一个自定义gridView和一个按钮.代码在后面
I have a Custom gridView and a Button in Frame Layout. Code is following
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridView
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_below="@+id/Rel_Spinner"
android:layout_centerHorizontal="true"
android:gravity="center"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" >
</GridView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
<Button
android:id="@+id/btnLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Load More" />
</FrameLayout>
</RelativeLayout>
它从适配器加载图像和文本.如图所示
It loads images and Text from adapter. as shown in figure
现在我想要的是,当到达GridView Scroll的最终位置时,Button应该出现,否则应该再次消失.如图所示.
Now I want is that the Button should appear when the final position of the GridView Scroll is reached other wise it should again disappear. as shown in figure.
推荐答案
您可以使用 查看全文