Or, you can render a progressbar onto a Canvas and then Canvas.drawText() using relative positions. getHeight<http://developer.android.com/reference/android/graphics/Canvas.html#getHeight()>() and getWidth<http://developer.android.com/reference/android/graphics/Canvas.html#getWidth()> () On Sat, Mar 21, 2009 at 7:18 AM, T patel <trushs...@gmail.com> wrote:
> > > > On Mar 10, 9:17 pm, David Yue <a52...@motorola.com> 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%"); > > > > > > > -- ~phunny.pha...@gmail.com ~mar...@archlinux.us --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---