Forum Archive

Reset the scrollbar of the Scrollview when it overflows?

[deleted]

"ScrollView.bounces
A boolean value that controls whether the scroll view bounces past the edge of content and back again."

But when I set the position of the scrollbar past the edge with code(scrollview.content_offset=(x,y)), it is stuck and can't be reset by itself.

mikael

@lpl, you can obviously avoid going past your content size programmatically, so I am assuming you want to create a bounce-like effect without the user doing the scrolling?

If that is the case, I would use Scripter (yes, that thing again) with one of the included easing functions to animate the bounce back to the end of content.

[deleted]

@mikael Thx. But I just made it with python again. … By using "ui.animate(reset_scrollbar, 0.5)".

mikael

@lpl, excellent, simple is often the best. My pain with ui.animate and ui.delay comes when I have to run several things in parallel or sequence, or when I need to apply easing functions for a more natural feel.

As an aside, I feel obliged to point out that the Scripter is also 100% Python.

[deleted]

@mikael Yeah. I'll try. The ui module in pythonista is still not kind of friendly towards me.