0

In my application i am using "galleryview" to display some images. Everything is working fine,but if i reached the last item means the scrolling should stop,but it is scrolling to the left most edge of the screen.

My galleryview layout parameter code:

DisplayMetrics metrics = new DisplayMetrics(); 
       getWindowManager().getDefaultDisplay().getMetrics(metrics); 
       MarginLayoutParams mlp = (MarginLayoutParams) gal.getLayoutParams(); 
       mlp.setMargins(-(metrics.widthPixels/2+90),mlp.topMargin,mlp.rightMargin, mlp.bottomMargin );   

Please help me ..Thanks in advance.

Subburaj
  • 5,114
  • 10
  • 44
  • 87

1 Answers1

1

I found no issues while implementing Gallery view. Because as the scroll bar is scrolled to the last thumb, it actually comes to the center of the screen, not to the left most edge. Proof:here If you could post your code by editing your question, there could be chances to have my answer edited according to your requirement. Even you can have a look at this great example. If you want to change the scrolling according to your requirement still, you can have look at this, though I didn't use this to change the default scroll feature. Even the above link which is provided by the altaf might also be of help to you.

Community
  • 1
  • 1
Spike
  • 147
  • 3
  • 17