Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 856 Bytes

3_styles.md

File metadata and controls

39 lines (32 loc) · 856 Bytes

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