装载纺车动画 [英] Loading spinning wheel animation

查看:114
本文介绍了装载纺车动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个搜索和填充一个ListView有结果,因为他们来。在顶部有一个酒吧与文本正在搜索...我想一个小纺车动画添加了酒吧右侧角球,表明这项工作正在做的用户。

I'm doing a search and populating a listview with results as they come. On top there's a bar with the text "Search in progress... " I'd like to add a small spinning wheel animation to the bar in the right corner, to show the user that work is being done.

您可以看到在画廊的应用程序,这纺车在右上角时被加载缩略图。此外,相同的动画显示在天文文件管理器,当文件被列在目录,(再次右上角)。

You can see this spinning wheel in the gallery app in the top right corner when thumbnails are being loaded. Also, the same animation is shown in Astro File Manager, when files are being listed in a directory, (again top right corner).

我如何把它放在那里?

推荐答案

您需要调用 requestWindowFeature 的onCreate 的setContentView

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setContentView(R.layout.search_screen);

和假设你使用的AsyncTask 用于填充列表

And Assuming you're using AsyncTask for Populating the list

在preExecute()将调用 setProgressBarIndeterminateVisibility(真);

onPostExecute()将调用 setProgressBarIndeterminateVisibility(假);

这篇关于装载纺车动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆