Question

Hey so I am using the standard design template to implement swipe navigation on a page. I have a main view controller that holds the center view and two side views. The center view is contained in a UIScrollView as to allows the user to scroll up and down. The right view is a table in which each cell links to static content. When I move to the page that has the static content and then back to the center view, the scroll view on the center view glitches and allows for "bouncing" in horizontally plane which messes up my swipe functionality. Is there a way to properly go back to the center view or programatically disable all scroll and bounce functionality in the horizontal plane?

Était-ce utile?

La solution

to disable bounce use this -> scrollView.bounces = NO; to disable horizontal scrolling set content size of scrollview like this ->

float sizeOfContent = 0;
UIView *lLast = [scrollView.subviews lastObject];
NSInteger wd = lLast.frame.origin.y;
NSInteger ht = lLast.frame.size.height;

sizeOfContent = wd+ht;

scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, sizeOfContent);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top