(iii) Customize the implementation of circular progress bars that are constantly spinning (primarily during network access, prompting the user to obtain data)

Source: Internet
Author: User

1. The progress bar to be realized is as follows:

2. The code in View_loading.xml is as follows:

<?XML version= "1.0" encoding= "Utf-8"?><Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:id= "@+id/loading_view_layout"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Android:background= "#e5e4e9"android:descendantfocusability= "Blocksdescendants" >    <RelativelayoutAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"android:layout_centerinparent= "true"android:gravity= "Top" >        <ProgressBarAndroid:id= "@+id/loading_view_progressbar"style= "@style/loadingviewprogressbarstyle"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_centerhorizontal= "true"android:visibility= "visible" />        <TextViewAndroid:id= "@+id/loading_view_textview"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_below= "@+id/loading_view_progressbar"Android:layout_centerhorizontal= "true"Android:layout_margintop= "4DP"Android:text= "Loading ..."Android:textcolor= "#999999"android:textsize= "12SP" />    </Relativelayout></Relativelayout>

3. The Loadingviewprogressbarstyle in Styles.xml are as follows:

<stylename= "Loadingviewprogressbarstyle">            <Itemname= "Android:indeterminatedrawable">@drawable/load_rotate</Item>            <Itemname= "Android:minwidth">20dip</Item>            <Itemname= "Android:maxwidth">20dip</Item>            <Itemname= "Android:minheight">20dip</Item>            <Itemname= "Android:maxheight">20dip</Item> </style>

4. The contents of the Load_rotate.xml file under the Drawable folder are as follows:

<? XML version= "1.0" encoding= "Utf-8" ?> <  xmlns:android= "http://schemas.android.com/apk/res/android"    android:drawable  = "@drawable/load_icon"    android:fromdegrees= "0"    android: Pivotx= "50%"    android:pivoty= "50%"    android:todegrees  = "/> "

5. The picture form of Load_icon is as follows:

(iii) Customize the implementation of circular progress bars that are constantly spinning (primarily during network access, prompting the user to obtain data)

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.