Tôi có thể đặt khoảng cách giữa các ngôi sao không? Thats ratingbar tôi:Khoảng cách giữa các dấu sao của một thanh đánh giá?
ratingBar = (RatingBar) inflater.inflate(R.layout.ratingbar, null);
ratingBar.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
Cách bố trí:
<?xml version="1.0" encoding="utf-8"?>
<RatingBar xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/myStyle" android:layout_alignParentRight="true"
android:layout_height="19dp" android:layout_width="wrap_content"
android:numStars="5">
</RatingBar>
Phong cách:
<style name="myStyle" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/android_r2_ratingstar_yellow</item>
<item name="android:indeterminateDrawable">@drawable/android_r2_ratingstar_grey</item>
</style>
Cảm ơn, cổ vũ
Bạn có thể thử thêm một phần đệm vào hình ảnh, bằng cách thêm một số đường viền trong suốt ở bên phải. –
Bạn đã giải quyết vấn đề này chưa? –