react-native-star-rating-view
StarRatingView for react-native, supporting decimal fraction and sliding rating.
Inspired by HCSStarRatingView
Demo
see the Demo

Install
Note: need react-native-vector-icons
If you do not want to import react-native-vector-icons
,
try the purejs branch
npm install react-native-star-rating-view --save
Usage
import StarRatingBar from 'react-native-star-rating-view/StarRatingBar'
...
<StarRatingBar
score={2.3}
dontShowScore={false}
allowsHalfStars={true}
accurateHalfStars={true}
/>
<StarRatingBar
readOnly={false}
continuous={true}
score={3.7}
onStarValueChanged={(score) => {
console.log('new score:' + score);
}}
/>
<StarRatingBar
starStyle={{
width: 20,
height: 20,
}}
readOnly={false}
continuous={true}
score={3.7}
allowsHalfStars={true}
accurateHalfStars={true}
onStarValueChanged={(score) => {
console.log('new score:' + score);
}}
/>
customize star image(自定义图片)
<StarRatingBar
score={2.3}
emptyStarImage={<Image style={{width:16, height: 16}} source={{uri: 'emptyStar.png: your image path'}} />}
filledStarImage={<Image style={{width:16, height: 16}} source={require('star.png: your image path')} />}
scoreTextStyle={{color:'#ff6666'}}
/>
<View style={{height: 60, flexDirection: 'row', alignItems: 'center'}}>
<StarRatingBar
score={2.3}
//emptyStarColor='#ff6666'
//tintColor='#ff6666'
starStyle={{
width: 26,
height: 26,
}}
emptyStarImage={<Image style={{width: 26, height: 26}} source={{uri: 'emptyStar.png: your image path'}} />}
filledStarImage={<Image style={{width: 26, height: 26}} source={require('star.png: your image path')} />}
scoreTextStyle={{color:'#ff6666'}}
/>
</View>
License
MIT