0
<?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

mmBs
  • 8,421
  • 6
  • 38
  • 46
mak035
  • 3
  • 4

3 Answers3

1
<?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.

John R
  • 2,078
  • 8
  • 35
  • 58
  • You guys are right but using scrollview inside the Framelayout is wrong it showing warning ,I myself find the solution .my code was write ,there was problem in my emulator thats y its not showing the scroll .the code which i posted now scrolling .thank you guys – mak035 Sep 12 '13 at 10:17
1

You can reduce gridView height and gridView will scrolled.

getKonstantin
  • 1,220
  • 9
  • 14
0

Somewhat unclear question but I guess you want this?

<FrameLayout>
<ScrollView>
<GridView> 
</GridView>
</ScrollView>
</FrameLayout>
Nicklas Gnejs Eriksson
  • 3,395
  • 2
  • 21
  • 19