StarRatingView for react-native, supporting decimal fraction and sliding rating.(星星评价打分组件:支持小数、滑动打分)
npm install react-native-star-rating-viewreact-native-vector-iconsIf you do not want to import react-native-vector-icons,
try the purejs branch
```
npm install react-native-star-rating-view --saveUsage
`js
import StarRatingBar from 'react-native-star-rating-view/StarRatingBar'
...
// readOnly, allow accurate value(只读、显示小数)
dontShowScore={false} // true: not show the score text view
allowsHalfStars={true}
accurateHalfStars={true}
/>
// sliding rating, not allow accurate value(滑动打分、不允许小数)
continuous={true}
score={3.7}
onStarValueChanged={(score) => {
console.log('new score:' + score);
}}
/>
// sliding rating, allow accurate value(滑动打分、精确到小数)
width: 20,
height: 20,
}}
readOnly={false}
continuous={true}
score={3.7}
allowsHalfStars={true}
accurateHalfStars={true}
onStarValueChanged={(score) => {
console.log('new score:' + score);
}}
/>
`
`js
// readOnly(默认只读、不显示小数)
//emptyStarColor='#ff6666'
//tintColor='#ff6666'
emptyStarImage={
filledStarImage={
scoreTextStyle={{color:'#ff6666'}}
/>
// customize star size(自定义尺寸大小)
//emptyStarColor='#ff6666'
//tintColor='#ff6666'
starStyle={{
width: 26,
height: 26,
}}
emptyStarImage={
filledStarImage={
scoreTextStyle={{color:'#ff6666'}}
/>
``