0

I have horizontal scrollView in it views(Buttons) are added dynamically.

What I want is when activity starts horizontal scrollView scrolls automatically right to left.

I'm stuck with this problem. Anyone know how can I achieve this ?

razlebe
  • 7,134
  • 6
  • 42
  • 57
Dhruvil Patel
  • 2,910
  • 2
  • 22
  • 39

1 Answers1

0

if you want to scroll on the extreme right:

int w = myHorizontalScroll.getWidth();
myHorizontalScroll.scrollTo( w, 0 );

if you want to scroll on the extreme left:

 myHorizontalScroll.scrollTo( 0, 0 );

if you want have a smooth scroll you can use

myHorizontalScroll.smoothScrollTo( w, 0 );
Stefano Ortisi
  • 5,288
  • 3
  • 33
  • 41