Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How do I change the height of a ProgressBar?

I was wondering what is the easiest way to change the height of a ProgressBar in Android?

Thanks,

Tomek

like image 526
Tomek Avatar asked Apr 29 '10 16:04

Tomek


People also ask

What is a difference between SeekBar and ProgressBar in Android?

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.

What is progress bar large in Android?

By default, the progress bar is full when the progress value reaches 100. You can adjust this default by setting the android:max attribute.

Which attribute is used to display ProgressBar horizontally?

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.


2 Answers

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.

like image 186
Jon W Avatar answered Sep 23 '22 18:09

Jon W


You need to replace

style=”?android:attr/progressBarStyleHorizontal”

to

style="@android:style/Widget.ProgressBar.Horizontal"

and layout_height will work

android:layout_height="50dp"
like image 22
rnofenko Avatar answered Sep 22 '22 18:09

rnofenko