Thanh Le
Thanh Le

Reputation: 1389

Android image slider like Ios

How can I make an android image slider that contains two parts. One part is an horizotal image slider (thumnail), the second part is an original image of the selected image. This look like ios horizontal view in ios: enter image description here

Upvotes: 0

Views: 1232

Answers (1)

Gaurav Arora
Gaurav Arora

Reputation: 17264

You need to use a Gallery and ImageView

1: Make a layout :

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">

   <ImageView
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="70"/>

    <Gallery
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="30"/>

</LinearLayout>

2: Initialize Gallery with adapter.

3: Define onItemClickListener for gallery items where you need to change imageView given above.

Alternatively, you can use the complete code given here : LINK (similar to what you are trying to do)

Upvotes: 1

Related Questions