A React Native component for generating and displaying interactive star ratings. Compatible with both iOS and Android.
JavaScript Objective-C Java
Switch branches/tags
Nothing to show
Clone or download
liuchungui Merge pull request #4 from bluejeans/master
Cleanup Imports to be Compatible with Recent RN Releases
Latest commit cecf429 Mar 9, 2017
Permalink
Failed to load latest commit information.
Example fix bug Mar 31, 2016
.gitignore add project Mar 30, 2016
LICENSE Initial commit Mar 30, 2016
README.md 修改代码样式 Mar 30, 2016
StarRating.js fix import issue Mar 8, 2017
package.json fix bug Mar 31, 2016

README.md

React Native Star Rating Component

A React Native component for generating and displaying interactive star ratings. Compatible with both iOS and Android.

#Installation

npm install react-native-rating-star --save

#Usage

import StarRating from 'react-native-rating-star';
class StarRaingDemo extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
        StarRating not set starSize and interitemSpacing.
        </Text>
        <StarRating
          maxStars={5}
          rating={1}
          selectStar={require('./select_star.png')}
          unSelectStar={require('./unselect_star.png')}
          valueChanged={this._valueChanged}
        />
        <Text style={styles.welcome}>
        StarRating set starSize.
        </Text>
        <StarRating
          maxStars={5}
          rating={2}
          selectStar={require('./select_star.png')}
          unSelectStar={require('./unselect_star.png')}
          valueChanged={this._valueChanged}
          starSize={25}
        />
        <Text style={styles.welcome}>
        StarRating set starSize and interitemSpacing
        </Text>
        <StarRating
          maxStars={5}
          rating={3}
          selectStar={require('./select_star.png')}
          unSelectStar={require('./unselect_star.png')}
          valueChanged={this._valueChanged}
          starSize={50}
          interitemSpacing={20}
        />
      </View>
    );
  }

  _valueChanged(rating) {
    console.log(rating);
  }
}