当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
2022-07-07 15:40:00 【XLMN】
进度条不使用progressBar组件,直接由activity方法启动
在窗口上面显示进度条有如下两步
1.调用activity的requeswindowfeatrue方法设置进度条的样式
2、调用activity的setprogressbarVisibility(boolean)和setprogressbarindeterminte visibility(boolean) 方法控制进度条的显示和隐藏
//public class MainActivity extends Activity {
// Button bt1, bt2;
// int time;
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// // TODO Auto-generated method stub
// super.onCreate(savedInstanceState);
//
// // 设置窗口特征:启用显示进度的进度条
// requestWindowFeature(Window.FEATURE_PROGRESS);
// // 设置窗口特征:启用不显示进度的进度条
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// setContentView(R.layout.jindu);
// bt1 = (Button) findViewById(R.id.button1);
// bt2 = (Button) findViewById(R.id.button2);
// // 为button 设置事件监听
// bt1.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // 显示不带进度的进度条
// setProgressBarIndeterminateVisibility(true);
// // 显示带进度的进度条
// setProgressBarVisibility(true);
// // 设置进度条的进度
// // 显示栏进度最大值是10000,如果是控件可以自己设置最大值
//
// new Thread() {
// public void run() {
// while (time < 100) {
//
// setProgress(times() * 100);
// }
// };
// }.start();
//
// }
// });
//
// // 设置隐藏进度条
// bt2.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // 隐藏不带进度的进度条
// setProgressBarIndeterminateVisibility(false);
// // 隐藏带进度的进度条
// setProgressBarVisibility(false);
//
// }
// });
//
// }
//
// public int times() {
// time++;
// try {
// Thread.sleep(100);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// return time;
// }
//}
//==========================
边栏推荐
- Share the latest high-frequency Android interview questions, and take you to explore the Android event distribution mechanism
- 使用popupwindow創建对话框风格的窗口
- rpcms获取指定分类下的文章的方法
- 【可信计算】第十一次课:TPM密码资源管理(三) NV索引与PCR
- [Seaborn] implementation of combined charts and multi subgraphs
- Sator launched Web3 game "satorspace" and launched hoobi
- 【TPM2.0原理及应用指南】 16、17、18章
- mysql使用笔记一
- 简单的loading动画
- 【可信计算】第十次课:TPM密码资源管理(二)
猜你喜欢
随机推荐
Jenkins发布uniapp开发的H5遇到的问题
99%的人都不知道|私有化部署还永久免费的即时通讯软件!
【可信计算】第十一次课:TPM密码资源管理(三) NV索引与PCR
Mrs offline data analysis: process OBS data through Flink job
Nerf: the ultimate replacement for deepfake?
LeetCode1051(C#)
Several best practices for managing VDI
The mail server is listed in the blacklist. How to unblock it quickly?
百度地图自定义样式向右拖拽导致全球地图经度0度无法正常显示
阿富汗临时政府安全部队对极端组织“伊斯兰国”一处藏匿点展开军事行动
Devops' operational and commercial benefits Guide
DatePickerDialog和trimepickerDialog
Leetcode brush questions day49
Problems encountered in Jenkins' release of H5 developed by uniapp
Mysql 索引命中级别分析
第3章业务功能开发(实现记住账号密码)
[source code interpretation] | source code interpretation of livelistenerbus
Siggraph 2022 best technical paper award comes out! Chen Baoquan team of Peking University was nominated for honorary nomination
麒麟信安加入宁夏商用密码协会
责任链模式 - Unity