Sanat Pandey
Sanat Pandey

Reputation: 4103

Click to scroll in Horizontal Scroll View

I want to scroll multiple items in Horizontal scroll view on the click of left and right arrow click which are resided in both corners. Means I have a Horizontal scroll view with two buttons left and right for scrolling items according to the same. I have searched enough on web but nothing matched. Please suggest me for the right solution regarding the same.

Upvotes: 0

Views: 1882

Answers (2)

jeet
jeet

Reputation: 29199

just set focus on next child, by using following methods:

`viewGroup.findFocus();

to get View which is focused,

and getNext vuew from layout and set focus on that view by:

view.requestFocus();

Upvotes: 0

tipycalFlow
tipycalFlow

Reputation: 7644

Use yourScrollView.scrollTo(x, y); in the button listener method. Add further conditions to limit the ends or to make it infinitely scrollable.

Go through the android documentation for more info...

Upvotes: 1

Related Questions