我如何获得垂直滚动GridView的机器人?机器人、如何获得、GridView

由网友(怎能淡忘)分享简介:我开发一个Android应用程序与显示图像。我使用网​​格视图展现在我的应用程序中的图像。 I am developing an android application with showing images. I am using grid view to show the images in my applica...

我开发一个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>
阅读全文

相关推荐

最新文章