Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 选择后,使用每个星星的不同自定义图像自定义分级栏_Android_Ratingbar - Fatal编程技术网

Android 选择后,使用每个星星的不同自定义图像自定义分级栏

Android 选择后,使用每个星星的不同自定义图像自定义分级栏,android,ratingbar,Android,Ratingbar,例如,我有一个5颗星的评级条。当我扫过或触摸任何一颗星星时,它会将所有星星从正常状态更改为某种颜色,因为它表明它是额定的 我想要的是,我们是否有可能为评级栏的每颗星提供5张独特的图片,而不是5张相同的星星 比如第一颗星是太阳像,第二颗星是月亮像,第三颗星是一些正方形的像等等 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pa

例如,我有一个5颗星的评级条。当我扫过或触摸任何一颗星星时,它会将所有星星从正常状态更改为某种颜色,因为它表明它是额定的

我想要的是,我们是否有可能为评级栏的每颗星提供5张独特的图片,而不是5张相同的星星

比如第一颗星是太阳像,第二颗星是月亮像,第三颗星是一些正方形的像等等

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" >

       <RelativeLayout 
            android:id="@+id/rl_rating"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp" >
            <RatingBar
               android:id="@+id/ratingBar"
               android:layout_width="wrap_content"
               android:layout_height="78dp"
               style="@style/CustomRatingBar" />
    </RelativeLayout>
</LinearLayout>

看看这个@saurabh64