当前位置:网站首页>在窗口上面显示进度条
在窗口上面显示进度条
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;
// }
//}
//==========================
边栏推荐
- First in China! Todesk integrates RTC technology into remote desktop, with clearer image quality and smoother operation
- 99%的人都不知道|私有化部署还永久免费的即时通讯软件!
- 【可信计算】第十次课:TPM密码资源管理(二)
- NeRF:DeepFake的最终替代者?
- 鲲鹏开发者峰会2022 | 麒麟信安携手鲲鹏共筑计算产业新生态
- redis主从、哨兵主备切换搭建一步一步图解实现
- notification是显示在手机状态栏的通知
- Sator launched Web3 game "satorspace" and launched hoobi
- 数值 - number(Lua)
- Share the latest high-frequency Android interview questions, and take you to explore the Android event distribution mechanism
猜你喜欢
Lex & yacc of Pisa proxy SQL parsing
Sator推出Web3游戏“Satorspace” ,并上线Huobi
A tour of grpc:03 - proto serialization / deserialization
第3章业务功能开发(用户访问项目)
【TPM2.0原理及应用指南】 5、7、8章
With the latest Alibaba P7 technology system, mom doesn't have to worry about me looking for a job anymore
【TPM2.0原理及应用指南】 9、10、11章
LeetCode刷题day49
Is AI more fair than people in the distribution of wealth? Research on multiplayer game from deepmind
Leetcode brush questions day49
随机推荐
alertDialog創建对话框
How to add aplayer music player in blog
Sator a lancé le jeu web 3 "satorspace" et a lancé huobi
麒麟信安加入宁夏商用密码协会
The mail server is listed in the blacklist. How to unblock it quickly?
数值 - number(Lua)
【TPM2.0原理及应用指南】 5、7、8章
防火墙系统崩溃、文件丢失的修复方法,材料成本0元
【网络攻防原理与技术】第1章:绪论
本周小贴士#136:无序容器
科普达人丨一文弄懂什么是云计算?
LeetCode 648(C#)
[fan Tan] those stories that seem to be thinking of the company but are actually very selfish (I: building wheels)
[Seaborn] combination chart: facetgrid, jointgrid, pairgrid
AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
Smart logistics platform: make overseas warehouses smarter
Mrs offline data analysis: process OBS data through Flink job
Flask搭建api服务-生成API文档
《世界粮食安全和营养状况》报告发布:2021年全球饥饿人口增至8.28亿
第3章业务功能开发(用户访问项目)