廓形仪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.

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