Thanks, is useful ;)

Le lundi 7 novembre 2011 18:10:07 UTC, Ryan a écrit :
>
> In order to display a percentage text inside Android's progressbar, 
> you will need to set up a <RelativeLayout>.  Give the RelativeLayout 
> parameters followed below: 
>
> android:layout_width="200dip" 
> android:layout_height="30dip" 
> android:padding="0dip" 
>
> Then close your RelativeLayout.  Inside your layout, insert your 
> <ProgressBar> with following parameters: 
>
> android:id="@+id/youridgoeshere" 
> android:layout_width="200dip" 
> android:layout_height="30dip" 
> android:layout_centerInParent="true" 
> style="?android:attr/progressBarStyleHorizontal" 
> android:indeterminateOnly="false" 
> android:max="100" 
>
> That's all for the progressbar, now on to the percentage text.  Create 
> a <TextView> inside your layout and give it the following parameters: 
>
> android:"@+id/youridgoeshere" 
> android:layout_width="wrap_content" 
> android:layout_height="wrap_content" 
> android:layout_centerInParent="true" 
> android:textColor="#000000" 
> android:textStyle="bold" 
>
> Close your TextView and there you have it!!! Your text should be 
> centered horizontally and vertically inside your progressbar.  The key 
> is to set up a relative layout while keeping it the same width as the 
> progress bar. Then using the parameter "centerInParent" keeps both the 
> progress bar and textview in the center of the relative parent.  Hope 
> this helps out. Enjoy!

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7ec9d605-91d8-446d-819f-853bfe75df72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to