Android进度栏监听器 [英] Android Progress Bar Listener
本文介绍了Android进度栏监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
总有时间知道进度条何时达到最大值.然后像侦听器一样可以插入ProgressBar并让我们知道进度条处于最高级别?
Is there anyway to know when a progressbar has reached it maximum. Like a Listener then could plug into the ProgressBar and lets us know that the progress bar is at the maximum level ?
亲切的问候
推荐答案
没有直接的方法可以做到这一点.一种解决方法是对ProgressBar进行自定义实现并覆盖setProgress方法:
There isn't a direct way to do this. A workaround could be to make a custom implementation of the ProgressBar and override the setProgress method:
public MyProgressBar extends ProgressBar
{
@Override
public void setProgress(int progress)
{
super.setProgress(progress);
if(progress == this.getMax())
{
//Do stuff when progress is max
}
}
}
这篇关于Android进度栏监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文