ios - How to stop a UIScrollView from scrolling when it reaches the bottom -


i have following code in place grab event when uiscrollview reaches end of content view:

- (void) scrollviewdidenddecelerating:(uiscrollview *) scrollview {     float currentendpoint = scrollview.contentoffset.y + scrollview.frame.size.height;      // cgpoint bottomoffset = cgpointmake(0, scrollview.contentsize.height - scrollview.bounds.size.height);     // [scrollview setcontentoffset:bottomoffset animated:no];      if (currentendpoint >= scrollview.contentsize.height)     {         // @ bottom 

i notice when scroll bottom hits , bounces up.

if add this:

cgpoint bottomoffset = cgpointmake(0, scrollview.contentsize.height - scrollview.bounds.size.height); [scrollview setcontentoffset:bottomoffset animated:no]; 

then scroll goes bottom.

is there way stay @ bottom without "bounce up" in once hits bottom, stop moving.

thanks.

you should uncheck bounce property of scrollview. check screenshot!

enter image description here


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -