Show horizontal progress bar I think of two kinds: Seekbar and ProgressBar, both of which can show progress, the most obvious difference is that Seekbar can be dragged by hand, for example, the user can control the sound effects in the application, control the progress of music playback, and so on, You can use drag bars to implement
A progress bar that needs to implement a percentage of voting:
ProgressBar layout:
Where background refers to the background of the progress bar background is gray
Some properties of ProgressBar are in the style
<style name= "Styleprogressbar" parent= "@android: Style/widget.progressbar.horizontal" >
<item name= "Android:maxheight" >50dip</item>
<item name= "Android:minheight" >10dip</item>
<item name= "Android:indeterminateonly" >false</item>
<item name= "android:indeterminatedrawable" > @android:d Rawable/progress_indeterminate_horizontal</item >
<item name= "android:progressdrawable" > @drawable/salondetail_progress_drawable</item>
</style>
Where progressdrawable is the green progress of the custom progress bar
Id:backgroud is the bottom gray background of the progress bar
: Id/secondaryprogress is the green on the progress bar
Set Android:max = "100" for easy calculation of percentages
Android uses ProgressBar to achieve percent display