I am following the standard example of how to add a RatingBar
. To control the number of stars I tried to use android:numStars=\"5\"
. The problem is
I'm also facing the problem that exceeding the stars than specified no of stars. For this, we don't want worry about whatever the layout type either relative or linear layout. Simply use the width as follows:
ratingBar.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
Please avoid using match_parent and fill_parent for ratingbar.
Hope the things would be helpful.