Sunday, February 26, 2012

Android, Creating a progress bar of custom size

By default, android gives you a small and a large sized spinner progress bar.
What if you want a spinner of a different size?
Easy, create a custom style in styles.xml in res/values




Trim the width / height values to your liking.

Define the progress bar in your view.xml and point to the style that you previously defined.

style="@style/Widget.ProgressBar.Medium"
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

Hope this helped!

0 Comments:

Post a Comment

<< Home