当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
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;
// }
//}
//==========================
边栏推荐
猜你喜欢

【网络攻防原理与技术】第6章:特洛伊木马

Nerf: the ultimate replacement for deepfake?

麒麟信安加入宁夏商用密码协会

Sator推出Web3遊戲“Satorspace” ,並上線Huobi

简单的loading动画

How to add aplayer music player in blog

科普达人丨一文弄懂什么是云计算?

【TPM2.0原理及应用指南】 12、13、14章

Sator推出Web3游戏“Satorspace” ,并上线Huobi

Skimage learning (3) -- adapt the gray filter to RGB images, separate colors by immunohistochemical staining, and filter the maximum value of the region
随机推荐
【TPM2.0原理及应用指南】 16、17、18章
麒麟信安操作系统衍生产品解决方案 | 存储多路径管理系统,有效提高数据传输可靠性
Skimage learning (3) -- adapt the gray filter to RGB images, separate colors by immunohistochemical staining, and filter the maximum value of the region
[Fantan] how to design a test platform?
VSCode关于C语言的3个配置文件
鲲鹏开发者峰会2022 | 麒麟信安携手鲲鹏共筑计算产业新生态
LeetCode 648(C#)
国内首创!Todesk将RTC技术融入远程桌面,画质更清晰操作更流畅
【饭谈】那些看似为公司着想,实际却很自私的故事 (一:造轮子)
【饭谈】Web3.0到来后,测试人员该何去何从?(十条预言和建议)
字符串 - string(Lua)
The mail server is listed in the blacklist. How to unblock it quickly?
【网络攻防原理与技术】第4章:网络扫描技术
Solidity函数学习
From Devops to mlops: how do it tools evolve to AI tools?
[fan Tan] those stories that seem to be thinking of the company but are actually very selfish (I: building wheels)
DNS 系列(一):为什么更新了 DNS 记录不生效?
Solid function learning
TabHOST 选项卡的功能和用法
无法链接远程redis服务器(解决办法百分百)