I am geting the decimal values like 1.0,1.5,2.0,2.5,etc...,when i clicks the stars
How to get whole number rating in custom ratingbar?
Is it Possible?
ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener()
{
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser)
{
Toast.makeText(Rating.this, "New Rating: " + rating, Toast.LENGTH_SHORT).show();
}});
}
您可以使用属性android:stepSize="1.0"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.