質問

I have a rating Bar

<RatingBar
            android:id="@+id/RATINGinitialvalueratingID"
            style="?android:attr/ratingBarStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/RATINGseekBarID"
            android:isIndicator="false"
            android:numStars="5" />

Say there are three stars in this .... i have two questions

  • How to show full stars all the time ?
  • How to disable editing of stars (static display of allocated rating)?
役に立ちましたか?

解決

Try to add the following attribute to show 5 stars:

android:rating="5"

Also, try to add those to make it not editable:

android:isIndicator="true"
android:focusable="false"
android:clickable="false"

他のヒント

Try this..

RatingBar ratingBar = (RatingBar)findViewById(R.id.RATINGinitialvalueratingID);
ratingBar.setRating(5);
ratingBar.setFocusable(false);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top