I was wondering what is the easiest way to change the height of a ProgressBar in Android?
Thanks,
Tomek
A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.
By default, the progress bar is full when the progress value reaches 100. You can adjust this default by setting the android:max attribute.
In Android, by default a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal. It mainly use the “android. widget. ProgressBar” class.
If your progress bar is defined in the XML layout, it looks like you define its height like so:
<ProgressBar
android:minHeight="20dip"
android:maxHeight="20dip"/>
However I'm just making a guess from this article.
You need to replace
style=”?android:attr/progressBarStyleHorizontal”
to
style="@android:style/Widget.ProgressBar.Horizontal"
and layout_height will work
android:layout_height="50dp"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With