Android Horizontal progress bar Demo

Source: Internet
Author: User

Progress bar: I believe we all understand that there is a progress bar, then to the user will not cause, a long wait and feel their own program hangs, so, this small demo can also take a look at, then, then we come to see exactly how to achieve.

1.:



2. Layout Description:

1.textview Display progress bar

2.ProgressBar progress bar

3. Progress bar Configuration:

<progressbar
Android:id= "@+id/pb"
Style= "@android: Style/widget.progressbar.horizontal"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:max= "/> "

Where: Max can be set manually, that is, the size of the content you downloaded, style is



3. Example source code:



4.dowork () method is a time-consuming operation of simulation, of course, you can also use other alternatives, such as: Download pictures on the Internet, downloaded, and then displayed and so on.

The above is the fruits of their own work, although small with mosquitoes, but also meat, hope to help everyone, thank you.



Android Horizontal progress bar Demo

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.