mak035
mak035

Reputation: 3

how to set scroll view in customized gridview of 2 columns

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    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:horizontalSpacing="0dp"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:verticalSpacing="0dp" />

</FrameLayout>

How to add scroll view in this layout i have to add more pictures in this layout bt its not showing more than 6 images

Upvotes: 0

Views: 739

Answers (3)

getKonstantin
getKonstantin

Reputation: 1250

You can reduce gridView height and gridView will scrolled.

Upvotes: 1

John R
John R

Reputation: 2064

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<ScrollView
android:id="@+id/scrollView1"
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:horizontalSpacing="0dp"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:verticalSpacing="0dp" />
</ScrollView>
</FrameLayout>

Try this.

Upvotes: 1

Nicklas Gnejs Eriksson
Nicklas Gnejs Eriksson

Reputation: 3415

Somewhat unclear question but I guess you want this?

<FrameLayout>
<ScrollView>
<GridView> 
</GridView>
</ScrollView>
</FrameLayout>

Upvotes: 0

Related Questions