我如何获得垂直滚动GridView的机器人? [英] How can i get Vertical scrolling in GridView android?
本文介绍了我如何获得垂直滚动GridView的机器人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发一个Android应用程序与显示图像。我使用网格视图
展现在我的应用程序中的图像。
I am developing an android application with showing images. I am using grid view
to show the images in my application.
但是默认的GridView是水平滚动
我要显示在垂直滚动
网格视图图像。
But default gridview is horizontal scrolling
I want to show the images in vertical scrolling
grid view.
请给我建议的方式来实现在GridView的垂直滚动。
Please suggest me a way to achieve vertical scrolling in gridview.
在此先感谢。
推荐答案
使用机器人:为numColumns =3//这将迫使GridView中有3列,如果你有超过3项网格视图,你可以有垂直滚动。
例:
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridView1"
android:numColumns="3"
android:gravity="center"
android:columnWidth="50dp"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</GridView>
这篇关于我如何获得垂直滚动GridView的机器人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文