Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a horizontal loading progress bar?

When uninstalling an android application, or do some configuration, there will show such a horizontal progress bar, like following picture:

progress bar

It's not the same style like @android:style/Widget.ProgressBar.Horizontal.

How to use it in my own application?

like image 605
Freewind Avatar asked Nov 16 '12 03:11

Freewind


2 Answers

Just add a STYLE line and your progress becomes horizontal:

<ProgressBar         style="?android:attr/progressBarStyleHorizontal"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/progress"         android:layout_centerHorizontal="true"               android:layout_centerVertical="true"               android:max="100"          android:progress="45"/> 
like image 164
Vitas Avatar answered Sep 21 '22 18:09

Vitas


It is Widget.ProgressBar.Horizontal on my phone, if I set android:indeterminate="true"

like image 38
Sergey Glotov Avatar answered Sep 21 '22 18:09

Sergey Glotov