当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
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;
// }
//}
//==========================
边栏推荐
- 企业即时通讯软件是什么?它有哪些优势呢?
- [Seaborn] implementation of combined charts and multi subgraphs
- Flask搭建api服务-生成API文档
- 本周小贴士#134:make_unique与私有构造函数
- L1-027 出租(Lua)
- 【TPM2.0原理及应用指南】 12、13、14章
- LeetCode 535(C#)
- The computer cannot add a domain, and the Ping domain name is displayed as the public IP. What is the problem? How to solve it?
- Flash build API service
- First in China! Todesk integrates RTC technology into remote desktop, with clearer image quality and smoother operation
猜你喜欢

TabHOST 选项卡的功能和用法

麒麟信安云平台全新升级!

【TPM2.0原理及应用指南】 16、17、18章
![[image sensor] correlated double sampling CDs](/img/1c/3a641ad47ff91536db602dedc82705.png)
[image sensor] correlated double sampling CDs

99%的人都不知道|私有化部署还永久免费的即时通讯软件!

第2章搭建CRM项目开发环境(搭建开发环境)

SIGGRAPH 2022最佳技术论文奖重磅出炉!北大陈宝权团队获荣誉提名

使用popupwindow創建对话框风格的窗口

Siggraph 2022 best technical paper award comes out! Chen Baoquan team of Peking University was nominated for honorary nomination

责任链模式 - Unity
随机推荐
Sator推出Web3遊戲“Satorspace” ,並上線Huobi
Skimage learning (2) -- RGB to grayscale, RGB to HSV, histogram matching
Skimage learning (1)
MRS离线数据分析:通过Flink作业处理OBS数据
rpcms获取指定分类下的文章的方法
[Seaborn] combination chart: pairplot and jointplot
Skimage learning (3) -- adapt the gray filter to RGB images, separate colors by immunohistochemical staining, and filter the maximum value of the region
阿富汗临时政府安全部队对极端组织“伊斯兰国”一处藏匿点展开军事行动
本周小贴士131:特殊成员函数和`= default`
[Seaborn] combination chart: facetgrid, jointgrid, pairgrid
Leetcode brush questions day49
Notes on installing MySQL in centos7
Solidity函数学习
LeetCode 535(C#)
【TPM2.0原理及应用指南】 1-3章
【信息安全法律法规】复习篇
alertDialog創建对话框
服务器彻底坏了,无法修复,如何利用备份无损恢复成虚拟机?
NeRF:DeepFake的最终替代者?
DevOps 的运营和商业利益指南