Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show exactly n Lines on a GridView

How can i show exactly 2 lines in a GridView and scroll to show the other items? Thanks in advance.

like image 953
Vervatovskis Avatar asked Dec 06 '25 10:12

Vervatovskis


1 Answers

You can give it a fixed height

<GridView
        android:id="@+id/gridView1"
        android:layout_width="fill_parent"
        android:layout_height="250dp"
        android:layout_marginLeft="25dp"
        android:layout_marginRight="25dp"
        android:layout_toRightOf="@+id/previous"
        android:columnWidth="150dp"
        android:horizontalSpacing="5dip"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:verticalSpacing="30dp" />
like image 131
Anu Avatar answered Dec 07 '25 22:12

Anu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!