当前位置:网站首页>Show progress bar above window

Show progress bar above window

2022-07-07 17:36:00 XLMN

Progress bar not used progressBar Components , Directly by the activity Method start up
There are two steps to display the progress bar on the window
1. call activity Of requeswindowfeatrue Method to set the style of the progress bar
2、 call activity Of setprogressbarVisibility(boolean) and setprogressbarindeterminte visibility(boolean) Method to control the display and hiding of the progress bar

<?xml version="1.0" encoding="utf-8"?>




//public class MainActivity extends Activity {
// Button bt1, bt2;
// int time;
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// // TODO Auto-generated method stub
// super.onCreate(savedInstanceState);
//
// // Set window features : Enable progress bar showing progress
// requestWindowFeature(Window.FEATURE_PROGRESS);
// // Set window features : Enable progress bars that do not show progress
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// setContentView(R.layout.jindu);
// bt1 = (Button) findViewById(R.id.button1);
// bt2 = (Button) findViewById(R.id.button2);
// // by button Set event listening
// bt1.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // Show progress bar without progress
// setProgressBarIndeterminateVisibility(true);
// // Show progress bar with progress
// setProgressBarVisibility(true);
// // Set the progress bar's progress
// // The maximum progress of the display bar is 10000, If it is a control, you can set the maximum value by yourself
//
// new Thread() {
// public void run() {
// while (time < 100) {
//
// setProgress(times() * 100);
// }
// };
// }.start();
//
// }
// });
//
// // Set hidden progress bar
// bt2.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // Hide the progress bar without progress
// setProgressBarIndeterminateVisibility(false);
// // Hide the progress bar with progress
// setProgressBarVisibility(false);
//
// }
// });
//
// }
//
// public int times() {
// time++;
// try {
// Thread.sleep(100);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// return time;
// }
//}
//==========================

原网站

版权声明
本文为[XLMN]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071527554254.html