廓形仪rn版本-技术调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.6 KiB

  1. import { Image, StyleSheet, Platform } from 'react-native';
  2. import { HelloWave } from '@/components/HelloWave';
  3. import ParallaxScrollView from '@/components/ParallaxScrollView';
  4. import { ThemedText } from '@/components/ThemedText';
  5. import { ThemedView } from '@/components/ThemedView';
  6. import { Button } from 'react-native-paper';
  7. import FileReadWriteExample from '@/components/ui/FileReadWriteExample';
  8. export default function HomeScreen() {
  9. return (
  10. <ParallaxScrollView
  11. headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
  12. headerImage={
  13. <Image
  14. source={require('@/assets/images/partial-react-logo.png')}
  15. style={styles.reactLogo}
  16. />
  17. }>
  18. <ThemedView style={styles.titleContainer}>
  19. <ThemedText type="title">Hello World!</ThemedText>
  20. <HelloWave />
  21. </ThemedView>
  22. <Button icon="camera" mode="contained" onPress={() => console.log('Pressed')}>
  23. Press me
  24. </Button>
  25. <FileReadWriteExample />
  26. <ThemedView style={styles.stepContainer}>
  27. <ThemedText type="subtitle">Step 1: Try it</ThemedText>
  28. <ThemedText>
  29. Edit <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> to see changes.
  30. Press{' '}
  31. <ThemedText type="defaultSemiBold">
  32. {Platform.select({
  33. ios: 'cmd + d',
  34. android: 'cmd + m',
  35. web: 'F12',
  36. })}
  37. </ThemedText>{' '}
  38. to open developer tools.
  39. </ThemedText>
  40. </ThemedView>
  41. <ThemedView style={styles.stepContainer}>
  42. <ThemedText type="subtitle">Step 2: Explore</ThemedText>
  43. <ThemedText>
  44. Tap the Explore tab to learn more about what's included in this starter app.
  45. </ThemedText>
  46. </ThemedView>
  47. <ThemedView style={styles.stepContainer}>
  48. <ThemedText type="subtitle">Step 3: Get a fresh start</ThemedText>
  49. <ThemedText>
  50. When you're ready, run{' '}
  51. <ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{' '}
  52. <ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{' '}
  53. <ThemedText type="defaultSemiBold">app</ThemedText> to{' '}
  54. <ThemedText type="defaultSemiBold">app-example</ThemedText>.
  55. </ThemedText>
  56. </ThemedView>
  57. </ParallaxScrollView>
  58. );
  59. }
  60. const styles = StyleSheet.create({
  61. titleContainer: {
  62. flexDirection: 'row',
  63. alignItems: 'center',
  64. gap: 8,
  65. },
  66. stepContainer: {
  67. gap: 8,
  68. marginBottom: 8,
  69. },
  70. reactLogo: {
  71. height: 178,
  72. width: 290,
  73. bottom: 0,
  74. left: 0,
  75. position: 'absolute',
  76. },
  77. });