Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the style of a ProgressBar to small?

I have some difficulties finding the correct way to specify that a progress bar should have the small indefinite style.

I would be glad if somebody could provide an example for me and others that do a quick search for this information.

like image 717
Janusz Avatar asked Aug 17 '10 07:08

Janusz


People also ask

How do I increase the size of my progress bar?

You try set Grid width=100 or bigger. And the ProgressRing should set HorizontalAlignment and verticalAlignment to Stretch and not any width,height and margin.

What is a difference between SeekBar and ProgressBar in android?

In Android, SeekBar is an extension of ProgressBar that adds a draggable thumb, a user can touch the thumb and drag left or right to set the value for current progress. SeekBar is one of the very useful user interface element in Android that allows the selection of integer values using a natural user interface.


2 Answers

The solution is to change the style to

<ProgressBar    android:layout_width="wrap_content"    android:layout_height="wrap_content"    style="?android:attr/progressBarStyleSmall" /> 
like image 75
Janusz Avatar answered Sep 24 '22 23:09

Janusz


One more way to do it is

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

Ex_

<ProgressBar  android:id="@+id/progress_bar"  style="@android:style/Widget.ProgressBar.Small"  android:layout_width="wrap_content"  android:layout_height="wrap_content"  android:padding="7dip"  arandroid:visibility="visible" /> 
like image 37
Rupesh Yadav Avatar answered Sep 24 '22 23:09

Rupesh Yadav