How can i change the star colors and how can i change the size of the stars ?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
The solutions that Alex and CommonsWares have posted are correct. One thing that the Android never talks about though is proper pixel sizes for different densities. Here are the required dimensions for each density based on halo light.
Small Star
Medium Star
Large Star
I found a simple solution for changing the color of the star according to your theme.
Goto this site : http://android-holo-colors.com/
Choose your theme color and get your star images created.
Building @lgvalle's answer.
This will keep the fraction steps colors.
From the API 21 on it's very easy to change the color of the stars with this three lines:
Doing so, you change the background color and the border color of the stars.
To change the color you just have to put set the parameter android:progressTint
For the size the style property.
The easiest way that worked for me...if you are extending AppCompat Activity
In your build.gradle add latest appcompat library.
Make your activity extend android.support.v7.app.AppCompatActivity
Declare custom style in your styles.xml file.
Apply this style to your RatingBar via android:theme attribute.