3 Styles
1.Declare Style
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'blue',
},
text: {
fontSize: 14,
color: 'red'
}
});
2.Using Styles
class Main extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.text}>I am red.</Text>
</View>
);
}
}
3.Properties
原文: https://unbug.gitbooks.io/react-native-training/content/3_styles.html