当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
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

With the latest Alibaba P7 technology system, mom doesn't have to worry about me looking for a job anymore

Skimage learning (2) -- RGB to grayscale, RGB to HSV, histogram matching

状态模式 - Unity(有限状态机)

【TPM2.0原理及应用指南】 9、10、11章

User defined view essential knowledge, Android R & D post must ask 30+ advanced interview questions

How to add aplayer music player in blog

Mrs offline data analysis: process OBS data through Flink job
Share the latest high-frequency Android interview questions, and take you to explore the Android event distribution mechanism

99%的人都不知道|私有化部署还永久免费的即时通讯软件!
随机推荐
Flash build API service
【可信计算】第十三次课:TPM扩展授权与密钥管理
【TPM2.0原理及应用指南】 1-3章
Siggraph 2022 best technical paper award comes out! Chen Baoquan team of Peking University was nominated for honorary nomination
浅谈 Apache Doris FE 处理查询 SQL 源码解析
actionBar 导航栏学习
智慧物流平台:让海外仓更聪明
PLC: automatically correct the data set noise, wash the data set | ICLR 2021 spotlight
【TPM2.0原理及应用指南】 9、10、11章
Biped robot controlled by Arduino
跟奥巴马一起画方块(Lua)
LeetCode1051(C#)
鲲鹏开发者峰会2022 | 麒麟信安携手鲲鹏共筑计算产业新生态
赋能智慧电力建设 | 麒麟信安高可用集群管理系统,保障用户关键业务连续性
【饭谈】Web3.0到来后,测试人员该何去何从?(十条预言和建议)
【黄啊码】为什么我建议您选择go,而不选择php?
The top of slashdata developer tool is up to you!!!
Lex & yacc of Pisa proxy SQL parsing
大笨钟(Lua)
First in China! Todesk integrates RTC technology into remote desktop, with clearer image quality and smoother operation