Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't disable bounce with UIScrollView and pagingEnabled=YES

I have UIViewController that hold UIScrollView inside it.

The m_scrollView is with pagingEnabled=YES;

On each "page" I have UIViewController that display article.

To prevent bouncing when the user swipe from page to page i used :

m_scrollView.bounces=NO;

and even

m_scrollView.alwaysBounceHorizonal=NO;

I notice the change was only to the last page that is not bounce. But when swiping the other pages, they bounce.

EDIT: the optimal solution was make the first and last page bounce ( so the user will get repsond there is no more pages\paging) and the other pages without bouncing

the annoying with the bounce when swiping pages is the bounce effect is not equal and same. somtimes it bounce more, and somtimes less.

I tought is somthing to do with the loading data in the pages, but I dont think it's the case, cause it happens also when all pages are loaded and no async operation of loading are happening in the background. Any ideas ?

EDIT 2 : I guess the bounce property is about the edge of the UIScrollView, But when moving from page to page there is also bouncing. Sometimes I can see a little of next-next page. For example : swiping from page 2 to page 3 , and in the animation of swiping I can see for 0.1 second page 4.

Also, the animation of swiping is not constant. and it feel that each swipe acts little diffrent. Thanks in advance.

like image 367
perr200 Avatar asked Aug 09 '11 21:08

perr200


1 Answers

just do this:

_scrollView = [[UIScrollView alloc]init];
_scrollView.pagingEnabled = YES;
_scrollView.bounces = NO; //Here

then, no bounce any more!

like image 113
Bruce Lee Avatar answered Sep 22 '22 13:09

Bruce Lee