tags:

views:

49

answers:

2

Hi Friends,

I am using grid view for images,first time i using 16 images display in gridview after i will add another 16 images in grid view,now totally 32 images in gridview,ok now i want to move scroll bar last 16 images position in grid view,how can dynamically scroll bar in grid view?,anybody know please give code..

Thanks All

A: 

You can use the smoothScrollToPosition method to "smoothly scroll to the specified adapter position."

gridView.smoothScrollToPosition(position);
Brian
@Thanks Brain,I can't add this method for gridview,
sivaraj
The smoothScrollToPosition method is an API Level 8 method, so you have to set your Project Target Build to Android 2.2 (API Level 8) or higher. It will not work on older versions.
Brian
A: 

If you don't want to force your application to use API level 8. So you can support other phones. Use:

http://developer.android.com/intl/fr/reference/android/widget/AdapterView.html#setSelection(int)

gridView.setSelection(position);
Blundell