更换动作条菜单图标与一个不确定的进度 [英] Replacing an ActionBar menu item icon with an indeterminate ProgressBar

查看:133
本文介绍了更换动作条菜单图标与一个不确定的进度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个不确定的进度栏添加到蜂窝动作条,让用户随时presses刷新,刷新图标暂时变成一个不确定的进度条,直到任务完成。电子邮件应用程序已经做了这个,但我无法弄清楚如何。

I would like to add an indeterminate progress bar to the Honeycomb ActionBar, so that any time the user presses "Refresh", the refresh icon temporarily turns into an indeterminate progress bar, until the task completes. The Email app does this already, but I can't figure out how.

任何意见?

推荐答案

很难说究竟是如何的电子邮件应用程序做它,但你可能想保持简单,只需要调用的 的setIcon与一名ID StateDrawable XML文件,然后只用一个定时器改变状态。

Hard to tell exactly how the Email app does it, but you may want to stay simple and just call setIcon with the id of a StateDrawable XML file, and then just change the state using a Timer.

这篇关于更换动作条菜单图标与一个不确定的进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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