Listview / Scrollview bounciness adjusting

Is it possible to change the way the bounce works in listview?
The scroll is fluid but the bounce it’s not like other native app, it’s too elastic with small retention.
It’s possible to customize in some way?

2 Likes

No way?
Ok maybe I’ll open a ticket for a request.

Yep, open the ticket pls. As far as I remember the parameters of the bounciness are hard coded.

1 Like

I’ve also noticed some odd behaviour with scrolling when if you’re close to the edge of a scrolling bound and flick quickly. It will scroll with fixed velocity to the threshold then ease back to the bound. Anyone else experienced this?

1 Like

Yes I noticed it too, especially when I have seen the last unity beta with improved scrolling for listview, they have adopted a really good native feeling bounciness

1 Like

Yes, open the ticket please

I remember fixing a bug in scrollview for the last game I made. Had to do with some size value in scrollview not getting set correctly. Is that behavior only happening when you scroll all the way to the right or top?

looking at my old code:

change:

void ScrollView::deaccelerateScrolling(float dt)

newX = _container->getPosition().x;
newY = _container->getPosition().y;
    
 _scrollDistance     = _scrollDistance * SCROLL_DEACCEL_RATE; 
this->setContentOffset(Vec2(newX,newY));

to

newX     = MIN(_container->getPosition().x, maxInset.x);
newX     = MAX(newX, minInset.x);
newY     = MIN(_container->getPosition().y, maxInset.y);
newY     = MAX(newY, minInset.y);

_scrollDistance   =  _scrollDistance - Vec2(newX - _container->getPosition().x, newY - _container->getPosition().y);
_scrollDistance   =  _scrollDistance * SCROLL_DEACCEL_RATE;
this->setContentOffset(Vec2(newX,newY));

Thanks @prespondek, but there’s no void ScrollView::deaccelerateScrolling(float dt) in cocos2d::ui::ScrollView !

ooohh… sorry, I thought you were referring to CCScrollview in the extensions directory not the Cocos widgets.

How about setBounceEnabled(false) ?