Priety
Priety

Reputation: 308

Auto Scroll of the GridView

I have got a requirement for my app and the requirement states that:

When the View of the GridView is filled and when the view moves down then the vertical scroll should scroll down automatically to show up the newly loaded images. I tried using:

gridView.smoothScrollToPosition(position); 
gridView.setSelection(position); 

But on using them my app is crashing. How to enable auto vertical scroll for a GridView? Help me out!!

Upvotes: 2

Views: 1959

Answers (1)

Royston Pinto
Royston Pinto

Reputation: 6721

You will have to use Instrumentation Library to scroll a gridview. It provides you with TouchUtils where you can override the drag function and perform a scroll on the view. Robotium is a free library that is available which is designed specially for this purpose.

http://code.google.com/p/robotium/

Refer the link along with thier tutorials. Once u get your hands dirty, you can take it to the next level. Also many people use robotium so you will find lots of resources to guide you.

Upvotes: 2

Related Questions