Analysis of Android progress bar related application skills

Source: Internet
Author: User

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)

 
 
  1. ProgressBar progressBarHorizontal = 
    (ProgressBar) findViewById(id.progressBarHorizontal);  
  2. progressBarHorizontal.setMax(100);  
  3. progressBarHorizontal.setProgress(30);  
  4. progressBarHorizontal.setSecondaryProgress(70); 

Android progress bar routine source code (Resource)

 
 
  1. < ProgressBar android:id="@+id/progressBarHorizontal" 
  2. android:layout_height="wrap_content" 
  3. android:layout_width="fill_parent" 
  4. style="?android:attr/progressBarStyleHorizontal" /> 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.