0

I'm writing an application in which i have to scroll different images one after another across the screen. In order to do that, i create a list of 10 ImageView items. These image view items are placed one after another like train coaches.

The question is how to scroll them from left to right. I thought of using scrollview, but it can accept only one child component and does vertical scrolling.

There is a Scroller class, but i'm not sure how to use it, i mean what does it scroll? I dont see any method like Scroller.scroll(view).

Another approach which i though was to user Layout animation such as TranslateAnimation, but then the end result is kind of shaky.

Can anyone point me to some sample of scrolling image from left to write. I don't want to use the gallery components because it defeats the objective of the application.

Thanks

prashant
  • 3,570
  • 7
  • 40
  • 50

3 Answers3

1

you can use HorizontalScrollView with a horizontal LinearLayout inside, containing your ImageViews.

bigstones
  • 15,087
  • 7
  • 65
  • 82
1

You can use HorizontalScrollView with a horizontal LinearLayout inside, containing your ImageViews.

You can do one more thing to override the following method in horizantalScrollview

@Override public boolean onTouch(View v, MotionEvent event) 
    {
       //...
    } 
Andreas Louv
  • 46,145
  • 13
  • 104
  • 123
Ragu
  • 11
  • 2
0

Gallery widget would much help you

Sreeram
  • 564
  • 1
  • 5
  • 15