我使用 SwipeRefreshLayout
为我的项目启用了“拉动刷新”。
当我向下移动时,出现加载指示器( Material 设计风格)。我知道,它必须如此工作,但我想禁用此功能,并通过单击某个按钮开始刷新并使用 SwipeRefreshLayout
加载指示器。
我该怎么做?
最佳答案
来自文档:
If an activity wishes to show just the progress animation, it should call setRefreshing(true). To disable the gesture and progress animation, call setEnabled(false) on the view.
所以要显示动画:
swiperefreshLayout.setEnabled(true);
swiperefreshLayout.setRefreshing(true);
并隐藏动画:
swiperefreshLayout.setRefreshing(false);
swiperefreshLayout.setEnabled(false);
关于android - 如何禁用 "pull to refresh"操作并仅使用指示器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30301451/