Android学习笔记(4)——基本控件之ProgressBar(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
private ProgressBar bar3 = (ProgressBar)findViewById(R.id.bar3);
private ProgressBar bar4 = (ProgressBar)findViewById(R.id.bar4);
start = (Button)findViewById(R.id.start);
start.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
if(i==0){
bar1.setVisibility(View.VISIBLE); //设置可见
bar2.setVisibility(View.VISIBLE);
bar3.setVisibility(View.VISIBLE);
bar4.setVisibility(View.VISIBLE);
}else if(i<100){
bar1.setProgress(i);
bar1.setSecondaryProgress(i+10); //设置辅进度条
bar2.setProgress(i);
bar3.setProgress(i);
bar4.setProgress(i);
}else{
bar1.setVisibility(View.GONE);
bar2.setVisibility(View.GONE);
bar3.setVisibility(View.GONE);
bar4.setVisibility(View.GONE);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>