android required example for using ratingbar in listview

前端 未结 2 1500
眼角桃花
眼角桃花 2021-01-14 18:04

I am learning android and want a sample code or an example for using ratingbar just to display ratings and no onclick events within a listview.

I am fetching the da

相关标签:
2条回答
  • 2021-01-14 18:23

    Did you try this tutorial?

    I hope this will help:

    Android Tutorial 7.4 ListView with RatingBar

    0 讨论(0)
  • 2021-01-14 18:36

    try the following code

    <RatingBar 
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:isIndicator="true"
        android:numStars="5"
        android:stepSize="1"
        android:rating="5"
        android:id="@+id/pop_ratingbar"
        style="?android:attr/ratingBarStyleSmall"
    />
    
    RatingBar ratingBar = (RatingBar) findviewbyid(R.id.pop_ratingbar);
    ratingBar.setRating(4.0f);
    

    still if you are facing problem than prefer the following project

    0 讨论(0)
提交回复
热议问题