Progress bar Simple Setup

Source: Internet
Author: User

Just set and no bird to use, only to see ...

Create a new XML in layout, called Main

<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" >    <ProgressBarAndroid:id= "@+id/progressbar2"style= "? Android:attr/progressbarstylelarge"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" />    <ProgressBarAndroid:id= "@+id/progressbar1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" /><!--Central does not set -    <ProgressBarAndroid:id= "@+id/progressbar3"style= "? Android:attr/progressbarstylesmall"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" />    <ProgressBarAndroid:id= "@+id/progressbar4"style= "? Android:attr/progressbarstylehorizontal"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content" /></LinearLayout>

Big Ring, Central ring, small ring, straight line progress bar.

Then go to the main file change, remember to change R.layout.main

 PackageCom.example.deemo;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.view.Window; Public classMainactivityextendsActivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); //Enable window features to enable with progress and without progressrequestwindowfeature (window.feature_progress);                Requestwindowfeature (window.feature_indeterminate_progress);        Setcontentview (R.layout.main); //show two progress barsSetprogressbarvisibility (true); Setprogressbarindeterminatevisibility (true); Setprogress (9999);//progress of the straight progress bar, the maximum amount is 10000    }}

Simply Express ~ and try another function later.

Progress bar Simple Setup

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.