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)