views:

349

answers:

1

Hi guys!!

I'm using a UIScrollerView and I found that it tends to "snap" back to a previous position when I scroll it.

I would like to simulate the behavior if the UItableView's scroller, that stays in the position where the user released his finger.

Thanks in advantage for your help

Alejandra

let me add the properties set:

[scroller setCanCancelContentTouches:NO];
scroller.clipsToBounds = YES; 
[scroller setScrollEnabled:YES];
scroller.userInteractionEnabled = YES;
scroller.alwaysBounceHorizontal = YES;
scroller.alwaysBounceVertical= NO;
scroller.showsVerticalScrollIndicator = NO;
scroller.scrollsToTop = NO;
scroller.bounces = NO;
scroller.pagingEnabled = NO;
A: 

There a few possible reasons for the snap back.

One could be that you have pagingEnabled set to YES which means that when the user lets go their finger, it will snap to the closest page boundary.

Another is that you have the contentSize set incorrectly. This is not the problem if you can actually scroll to the top and bottom and leave it there without it bouncing away.

mahboudz
Thanks mahboudz!! I pasted the configuration that I have for the scroller, I just changed the pagingEnabled and i got the same behavior :(Thanks again :) Alejandra
Alejandra Gonzalez
You're welcome, but I am not sure I understand. Did this resolve your problem? Or do you need more help?
mahboudz
Can you scroll to the bottom or the top and have it stay at that location or does it always bounce away?
mahboudz
I tried your recommendation but it didn't solve the problem :(, I'm able to scroll from the bottom to the top, but if I want to stay in some point in the middle the scroller moves back/forward into another position.
Alejandra Gonzalez
Thanks mahboudz!!!!!!!!, your recommendation was right. I was overwriting the pagingEnabled property to YES in other part of my code :$, Thanks a lot for your help :) Alejandra
Alejandra Gonzalez