On Mar 10, 9:17 pm, David Yue <[email protected]> wrote:
> Hi,
> I am trying to implement a ProgressBar with text over it. Below is my
> general idea:
>
> In layout *.xml file, I define it as below:
> <ProgressBar android:id="@+id/progress_ID"
> style="?android:attr/progressBarStyleHorizontal"
> android:layout_width="200dip"
> android:layout_height="wrap_content"
> android:max="100"
> android:progress="50" />
>
> In Java code, I do like this:
> final ProgressBar progress;
> progress = (ProgressBar) v.findViewById(R.id.progress_ID);
> progress.setProgress(99);
>
> BUT I have no idea how to display a text like "50%" over the
> ProgressBar. I gone through progress realted mehtods, not found useful
> refrence. Do you have any idea? or I must use another way?
> thanks a lot!
>
> BR,
> David
try this code
progress = (ProgressBar) v.findViewById(R.id.progress_ID);
progress.setProgress(99);
then try
progress.setMessage("0%");
......
//some process load
.......
progress.setMessage("50%");
.......
//some process load
........
progress.setMessage("100%");
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---