• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Infinite Scrolling of items created in two Linear Layout in Android.

  • Thread starter Thread starter Android Question
  • Start date Start date
A

Android Question

Guest
I divide my screen in two parts, one of the parts contain five buttons and another part contain seven ImageView with images. Now I want that ImageView rotate infinite,means, after last image, again images start to come. My XML is








<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="horizontal"

android:baselineAligned="true"

tools:context="in.example.splitapp.MainActivity" >

<ScrollView

android:id="@+id/scrollView"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:layout_weight="1"

>

<RelativeLayout

android:id="@+id/linearLayout1"

android:orientation="vertical"

android:layout_weight="1"

android:layout_height="fill_parent"

android:layout_width="fill_parent"

android:background="@android:color/holo_green_dark">

<Button android:id="@+id/button1"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:text="DOG"/>

<Button android:id="@+id/button2"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/button1"

android:text="CAT"/>

<Button android:id="@+id/button3"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/button2"

android:text="COW"/>

<Button android:id="@+id/button4"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/button3"

android:text="RAT"/>

<Button android:id="@+id/button5"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/button4"

android:text="PARROT"/>

</RelativeLayout>

</ScrollView>

<ScrollView

android:id="@+id/scrollView2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:layout_weight="1"

>

<RelativeLayout

android:id="@+id/linearLayout2"

android:orientation="horizontal"

android:layout_weight="1"

android:layout_height="fill_parent"

android:layout_width="fill_parent"

android:background="@android:color/holo_purple"

>



<ImageView android:id="@+id/imageView1"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:background="@drawable/dog"

android:text="DOG"/>

<ImageView android:id="@+id/imageView2"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView1"

android:background="@drawable/cat"

android:text="CAT"/>

<ImageView android:id="@+id/imageView3"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView2"

android:background="@drawable/cow"

android:text="COW"/>

<ImageView android:id="@+id/imageView4"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView3"

android:background="@drawable/rat"

android:text="RAT"/>

<ImageView android:id="@+id/imageView5"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView4"

android:background="@drawable/parrot"

android:text="PARROT"/>

<ImageView android:id="@+id/imageView6"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView5"

android:background="@drawable/horse"

android:text="HORSE"/>

<ImageView android:id="@+id/imageView7"

android:layout_width="match_parent"

android:layout_height="100dp"

android:layout_centerHorizontal="true"

android:layout_below="@id/imageView6"

android:background="@drawable/fish"

android:text="FISH"/>

</RelativeLayout>



</ScrollView>

</LinearLayout>

Now I want that ImageView side scrolling infinite means these five images repeated always. Please do the needful. Thanks in advance.
 
Back
Top Bottom