【发布时间】:2018-06-24 02:14:18
【问题描述】:
我正在使用 Kivy 技术开发一个应用程序,我想展示一个拉动刷新行为。我所做的最多的是滚动视图并控制是否要刷新 scroll_y 坐标,但这具有仅在有滚动时才起作用而在没有滚动时不起作用的缺点。
<TrytonTree>
app: app
container: container
do_scroll_x: False
on_scroll_y: root.init_pull(self.scroll_y)
on_scroll_stop: root.pull(self.scroll_y)
MDList:
id: container
...
class TrytonTree(ScrollView, TrytonTreeMixin):
def pull(self, scroll_y):
if scroll_y >= 2:
self.app.refresh_screen([self.get_model_name()])
Clock.schedule_once(self.app.disable_spinner, 2)
def init_pull(self, scroll_y):
if scroll_y >= 2:
self.app.enable_spinner()
所以我的问题是是否有控制滑动手势的方法,以便我可以调用刷新功能或类似的东西。
谢谢。
【问题讨论】: