listview - Android static percentage bar view - not a progress bar -


i'm trying show items in listview so:

    a. name1         80.33 ======      60%      b. name2        101.22 =======     70%      c. name3         55.22 ===         30%      d. name4        140.11 ========== 100% 

the "graph" should solid colored line entire width of 100% needs there, , should occupy entire width available except value on far left , percentage on far right. percentages more percentiles, relative lowest value in set!

anyway have tried framelayout progressbar , seems ill-suited plus can't lay out way want. i'm thinking 1px colored image stretch percent need 1px dark image rest of way.

any ideas? thanks!

edit: ok progress new problem:

here's did in layout:

    <view         android:id="@+id/pr_bar_1"         android:layout_width="30dip"         android:layout_height="4dip"         android:layout_gravity="center_vertical"         android:background="#ffffff" />      <view         android:id="@+id/pr_bar_2"         android:layout_width="70dip"         android:layout_height="4dip"         android:layout_gravity="center_vertical"         android:background="#333333" /> 

that looks want! however... can't seem set widths dynamically now. there no setlayoutwidth(int dip) method view class. if i'd done. ideas? thanks!

if want custom, write own view , override ondraw want.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -