-1

I have to add around 15 images in an android page. But in the existing graphical layout in eclipse, I can add only that many images which will fill the page, say four of them. How to add the rest of these images, so that they appear below these images on scrolling. In other words how to extend the page?

Bhavin Chowksi
  • 105
  • 3
  • 8
  • What is your XML layout currently? Are you storing your images in a `GridView`? If not, you can do that to have scrollability. You could also structure it so that you put your images in horizontal `LinearLayouts` which themselves are in one main vertical `LinearLayout` that exists inside a `ScrollView`. Either way will give you scrollability. Try doing a google search next time... – u3l Aug 30 '14 at 06:38
  • ok i wasnt knowing bout scrollview...googlin didnt help...thanks – Bhavin Chowksi Aug 30 '14 at 06:41
  • if you have got your answer than accept answer so other can get help from your contribution – MilapTank Oct 07 '14 at 06:16

1 Answers1

1

use ScrollView As you have ask for only 15 images if images are daynamic than use List for dishpaly images

image_scroll_layout.xml

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="your_image" />

          ........up to 15

       <ImageView
            android:id="@+id/imageView15"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="your_image" />
    </LinearLayout>
</ScrollView>
MilapTank
  • 9,988
  • 7
  • 38
  • 53