react-native-navigation的迁移库

TopTabScreen.js 989B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const React = require('react');
  2. const { PureComponent } = require('react');
  3. const { View, Text } = require('react-native');
  4. class TopTabScreen extends PureComponent {
  5. static get options() {
  6. return {
  7. topBar: {
  8. textColor: 'black',
  9. textFontSize: 16,
  10. textFontFamily: 'HelveticaNeue-Italic'
  11. }
  12. };
  13. }
  14. render() {
  15. return (
  16. <View style={styles.root}>
  17. <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
  18. <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
  19. </View>
  20. );
  21. }
  22. }
  23. module.exports = TopTabScreen;
  24. const styles = {
  25. root: {
  26. flexGrow: 1,
  27. justifyContent: 'center',
  28. alignItems: 'center',
  29. backgroundColor: '#f5fcff'
  30. },
  31. h1: {
  32. fontSize: 24,
  33. textAlign: 'center',
  34. margin: 10
  35. },
  36. h2: {
  37. fontSize: 12,
  38. textAlign: 'center',
  39. margin: 10
  40. },
  41. footer: {
  42. fontSize: 10,
  43. color: '#888',
  44. marginTop: 10
  45. }
  46. };