Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppCompat ProgressBar height

How to change the height of AppCompat ProgressBar?
I try with this, but no result

<ProgressBar
    android:id="@+id/progressBar"
    style="@style/Widget.AppCompat.ProgressBar.Horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:indeterminate="false"
    android:max="100"
    android:progress="60"
    android:minHeight="20dp"
    android:maxHeight="20dp"
    android:progressBackgroundTint="@color/pbarbg"
    android:theme="@style/LinearProgress" />

And in LinearProgress style I have

<style name="LinearProgress" parent="Theme.AppCompat.Light">
    <item name="colorAccent">@color/pbaractive</item>
</style>
like image 358
HK.avdalyan Avatar asked Feb 09 '16 11:02

HK.avdalyan


People also ask

What are the different types of progress bars?

There are 2 types of progress bars: determinate and indeterminate. The former is used when the amount of information that needs to be loaded is detectable. The latter is used when the system is unsure how much needs to be loaded or how long it will take.

How do I make my progress bar horizontal android?

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.


1 Answers

You can use setScaleY() method, to scale your ProgressBar in Y-axis.

eg: yourProgressBar.setScaleY(2f);

like image 171
Rami Avatar answered Sep 28 '22 02:09

Rami