ProgressBar is divided into vertical and horizontal
Often during the data loading process, in order to make the user feel friendly, pop up a circular loading box
Levels are often used when downloading applications and are accompanied by download progress.
There are four types of ProgressBar styles:
Android:progressbarstyle: Default progress bar style, indeterminate mode
Android:progressbarstylehorizontal: Horizontal progress bar Style
Android:progressbarstylelarge: Large progress bar style, also indeterminate progress mode
Android:progressbarstylesmall: Small progress bar style, also indeterminate progress mode
Change the style of ProgressBar styles to achieve different effects
the first: Custom style simple way only need to modify progressbar properties drawable loaded pictures, you can implement different styles
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android "android:orientation=" vertical "android:layout_width=" fill_parent "android:layout_height=" Fill_parent " android:gravity= "center" ><progressbarandroid:indeterminatedrawable= "@drawable/d_stroke" Android:layout_ height= "100DP" android:layout_width= "100DP"/></linearlayout>
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android "android:orientation=" vertical "android:layout_width=" fill_parent "android:layout_height=" Fill_parent " android:gravity= "center" ><progressbarandroid:indeterminatedrawable= "@drawable/d_shape" Android:layout_ height= "100DP" android:layout_width= "100DP"/></linearlayout>
The second is to modify its system properties and property values according to the style of the system itself.
First Look at style = "? Android:attr/progressbarstylelarge" the source code, in \frameworks\base\core\res\res\values\styles.xml
<style name= "Progressbarstylelarge" > <item name= "android:indeterminatedrawable" > @drawable/progress_ large</item> <item name= "android:minwidth" >76dip</item> <item name= "Android:maxwidth" > 76dip</item> <item name= "android:minheight" >76dip</item> <item name= "Android:maxheight" > 76dip</item></style>
The third is the second type of workaround, custom style inherits the system's style
<style name= "Myprogressbarstylelarge" parent= "Progressbarstylelarge" > <item name= "android: Indeterminatedrawable "> @drawable/progress_large</item> <item name=" Android:minwidth ">76dip</ item> <item name= "android:maxwidth" >76dip</item> <item name= "Android:minheight" >76dip</ item> <item name= "Android:maxheight" >76dip</item></style>