Many functions of the Android mobile phone operating system play a major role in practical applications. For example, the implementation of the Android progress bar introduced here can help you solve some problems. Let's take a look at the relevant methods.
- Common types of Android Class Libraries
- Analysis of Android Menu Programming Method
- Analysis of Android resource application skills
- Android ListView complex usage
- Android uses XML-related skills
● The progress bar contains two types: indeterminate = true and indeterminate = false.
The default value is uncertain indeterminate = true) Android progress bar.
● The Android progress bar can be used in four styles.
The default value is progressBarStyle.
When it is set to progressBarStyleSmall, the icon becomes smaller.
When it is set to progressBarStyleLarge, the icon becomes larger.
After being set to progressBarStyleHorizontal, it becomes a horizontal rectangle.
● Confirm the setting of the maximum value in the indeterminate = false) progress bar and call the setMax () method.
● Call the setProgress () method to set the current progress value in the Android progress bar.
● Set the 2nd Progress value and call the setSecondaryProgress () method.
Routine source code (Java)
- ProgressBar progressBarHorizontal =
(ProgressBar) findViewById(id.progressBarHorizontal);
- progressBarHorizontal.setMax(100);
- progressBarHorizontal.setProgress(30);
- progressBarHorizontal.setSecondaryProgress(70);
Android progress bar routine source code (Resource)
- < ProgressBar android:id="@+id/progressBarHorizontal"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- style="?android:attr/progressBarStyleHorizontal" />