当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
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;
// }
//}
//==========================
边栏推荐
- 策略模式 - Unity
- 让保险更“保险”!麒麟信安一云多芯云桌面中标中国人寿, 助力金融保险信息技术创新发展
- Rpcms method of obtaining articles under the specified classification
- Sator a lancé le jeu web 3 "satorspace" et a lancé huobi
- DatePickerDialog和trimepickerDialog
- Matplotlib绘制三维图形
- [fan Tan] after the arrival of Web3.0, where should testers go? (ten predictions and suggestions)
- PLC:自动纠正数据集噪声,来洗洗数据集吧 | ICLR 2021 Spotlight
- 字符串 - string(Lua)
- 网络攻防复习篇
猜你喜欢
随机推荐
如何在软件研发阶段落地安全实践
【可信计算】第十一次课:TPM密码资源管理(三) NV索引与PCR
国内首创!Todesk将RTC技术融入远程桌面,画质更清晰操作更流畅
跟奥巴马一起画方块(Lua)
notification是显示在手机状态栏的通知
LeetCode 890(C#)
Solidity函数学习
Rpcms method of obtaining articles under the specified classification
mysql使用笔记一
服务器彻底坏了,无法修复,如何利用备份无损恢复成虚拟机?
Solidity 开发环境搭建
Test case management tool recommendation
Flask搭建api服务-生成API文档
alertDialog創建对话框
Skimage learning (1)
AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
Share the latest high-frequency Android interview questions, and take you to explore the Android event distribution mechanism
本周小贴士#134:make_unique与私有构造函数
Lex & yacc of Pisa proxy SQL parsing
Flask build API service SQL configuration file









