App05Styles.js 644 B

123456789101112131415161718192021222324252627282930313233
  1. import React from "react";
  2. import {
  3. StyleSheet,
  4. Text,
  5. View,
  6. } from 'react-native';
  7. const styles = StyleSheet.create({
  8. bigblue: {
  9. color: 'blue',
  10. fontWeight: 'bold',
  11. fontSize: 30,
  12. },
  13. red: {
  14. color: 'red',
  15. },
  16. });
  17. class LotsOfStyles extends React.Component {
  18. render() {
  19. return (
  20. <View>
  21. <Text style={styles.bigblue}>Just big blue</Text>
  22. <Text style={styles.red}>Just red</Text>
  23. <Text style={[styles.bigblue, styles.red]}>Big blue, then red</Text>
  24. <Text style={[styles.red, styles.bigblue]}>Red, then big blue</Text>
  25. </View>
  26. );
  27. }
  28. }
  29. export default LotsOfStyles;