gpt4 book ai didi

android - 刷新时如何恢复 (sherlock) ListView 中的负载指示器?

转载 作者:行者123 更新时间:2023-11-29 16:08:42 25 4
gpt4 key购买 nike

观察下图。在我在我的 SherlockListFragment 中设置 ListAdapter 之前,它会代替 ListView 数据显示。我不知道这是 SherlockActionBar 还是标准 Android 的产品,但无论如何 - 我以后如何恢复它?我的用例是我有一个刷新按钮,当用户按下该按钮时,我希望清除列表并在加载时再次出现微调器。

Image of load indicator (spinner)

最佳答案

在您的 SherlockListFragment 中,调用 setListShown(false);

兼容性文档ListFragment (SherlockListFragment 扩展自)状态:

Control whether the list is being displayed. You can make it not displayed if you are waiting for the initial data to show in it. During this time an indeterminant progress indicator will be shown instead.

当然,刷新完成后,调用 setListShown(true);

关于android - 刷新时如何恢复 (sherlock) ListView 中的负载指示器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15442674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com