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>
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.
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.
You can use setScaleY()
method, to scale your ProgressBar
in Y-axis.
eg: yourProgressBar.setScaleY(2f);
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