djchie / react-native-star-rating

A React Native component for generating and displaying interactive star ratings
833 stars 200 forks source link

Created in android #28

Open Altraman opened 7 years ago

Altraman commented 7 years ago

But it's wrong! qq20161218-220001

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
} from 'react-native';

import StarRating from 'react-native-star-rating';

export default class StarRaingDemo extends Component {
    constructor(props) {
        super(props);
        this.state = {
            starCount: 3.5
        };
    }

    onStarRatingPress(rating) {
        this.setState({
            starCount: rating
        });
    }

    render() {
        return (
            <View>
                <StarRating disabled={false}
                            maxStars={5}
                            rating={this.state.starCount}
                            starColor={'red'}
                            emptyStar={'target-two'}
                            fullStar={'thumbnails'}
                            halfStar={'torso'}
                            iconSet={'Foundation'}
                            selectedStar={(rating) => this.onStarRatingPress(rating)}/>
            </View>
        ); 
    }
}
AppRegistry.registerComponent('BackUp', () => StarRaingDemo);
Leealen commented 6 years ago

same problem

Al10s commented 5 years ago

If you don't see the icons, make sure you followed the react-native-vector-icons installation guide

mgsantos177 commented 4 years ago

i've the same problem, i had followed the react-native-vector-icons installation guide, i'm using icons in others components, but only in the star-rating that icons don't appear