0
Hello, I’m using a rating bar in android studio and I used the following in the layout:
<RatingBar
android:id="@+id/ratingBar"
style="?android:attr/ratingBarStyleSmall"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#ffffff"
android:isIndicator="false"
android:numStars="5"
android:padding="5dp"
android:stepSize="1"
android:layout_width="wrap_content" />
Turns out there’s no way she gets five stars, she gets four and a little bit of five. Does anyone know how to fix this? Thank you.
hello @Elaine Breda Schwaner, try setar
android:layout_width="match_parent"
instead ofandroid:layout_width="wrap_content"
– Armando Marques Sobrinho
Thanks for the answer, but I’ve tried this. What happens with the match is that there appears much more than 5 stars.
– Elaine Breda Schwaner
I’ve never used it in my apps, but I’ll do some tests here, if you can
– Armando Marques Sobrinho
Ready, tested there, I put
android:numStars="6"
and came up at 5 o'clock in the morning. Thanks for giving me this tip, I had never really found myself for this component, I laughed– Armando Marques Sobrinho
In mine, it didn’t work... If I put 6 appears 5 and a little bit of 6
– Elaine Breda Schwaner
try then to
android:layout_width="90dp"
for example and decreasing or increasing the value of widith until the one that is half gone, here in mine is normal regardless of the number of Stars I use– Armando Marques Sobrinho
No gave. Because then it varies the number of stars according to the size of the user’s phone
– Elaine Breda Schwaner