博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ProgressDialog 的xml 功能布局
阅读量:7126 次
发布时间:2019-06-28

本文共 1058 字,大约阅读时间需要 3 分钟。

而选择动画进度条显示进度:

1.   用类构造器初始化进度对话框,ProgressDialog(Context)。

2.   用setProgressStyle(int)方法设置进度风格为"STYLE_HORIZONTAL"以及设置其它属性,比如消息。

创建ProgressDialog大概是这样的:

  1. ProgressDialog progressDialog = new ProgressDialog(getApplicationContext());  
  2.   
  3. progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);  
  4. progressDialog.setIcon(R.drawable.alert_dialog_icon);  
  5. progressDialog.setMessage("Loading...");  
  6. progressDialog.setCancelable(false);  

3.   当你准备显示这个对话框时,调用show()或者从onCreateDialog(int)回调中返回ProgressDialog。

4.   你可以通过调用setProgress(int)设置当前进度百分比或者调用incrementProgressBy(int)方法增加进度值。

<ProgressBar android:id=”@+id/ProgressBar01″ 

android:layout_width=”wrap_content” 
android:layout_height=”wrap_content”> 
</ProgressBar> 
<ProgressBar android:id=”@+id/ProgressBar02″ 
style=”?android:attr/progressBarStyleLarge”           大圆圈 
android:layout_width=”wrap_content” 
android:layout_height=”wrap_content”> 
</ProgressBar> 
<ProgressBar android:id=”@+id/ProgressBar03″ 
style=”?android:attr/progressBarStyleSmall”          小圆圈 
android:layout_width=”wrap_content” 
android:layout_height=”wrap_content”> 
</ProgressBar> 

转载地址:http://uchel.baihongyu.com/

你可能感兴趣的文章
Spring实现AOP的几种方式详解
查看>>
海量数据处理专题(五)——堆
查看>>
我的友情链接
查看>>
Linux下双网卡双网关配置路由表
查看>>
Windows Server 2012 和 System Center 2012 SP1,Virtual Machine Manager 中启用的软件定义的网络...
查看>>
跟我学习dubbo-Dubbo管理控制台的安装(3)
查看>>
Divice eth0 dose not seem to be present ,delaying initalization解决办法
查看>>
02-03-linux根文件系统详解
查看>>
HTML5+JavaScript+CSS实现音乐播放器——难点二:自己设计一个控制音乐播放的控制器...
查看>>
Django数据库读取出下拉框的数据源
查看>>
程序员必须要掌握的十大经典算法
查看>>
oracle redo日志维护
查看>>
MFC第五课 使用COM读取EXCEL文件
查看>>
psutil模块安装
查看>>
二叉树链接右指针II
查看>>
centos7+docker综合实验
查看>>
基本概念学习(7004)---三层交换机
查看>>
Awstats-日志分析
查看>>
用ImageBuilder定制自己的openwrt路由器
查看>>
shell脚本检测mysql是否启动的方法
查看>>