开始开发
编辑页面
对 Expo 项目进行第一次修改,并在你的设备上实时查看效果。
For the complete documentation index, see llms.txt. Use this Use this file to discover all available pages.
2
3
进行你的第一次修改
在代码编辑器中打开 src/app/index.tsx 文件并进行一次修改。
| 17 | 17 | <ThemedView style={styles.heroSection}> |
| 18 | 18 | <AnimatedIcon /> |
| 19 | 19 | <ThemedText type="title" style={styles.title}> |
| 20 | 欢迎使用 Expo | |
| 20 | 你好,世界! | |
| 21 | 21 | </ThemedText> |
| 22 | 22 | </ThemedView> |
| 23 | 23 |
设备上没有显示更改?
Expo Go 默认配置为在文件发生更改时自动重新加载应用,但我们还是来确认一下启用它的步骤,以防万一某些地方没有正常工作。
-
确保你已在 Expo CLI 中启用开发模式。
-
关闭 Expo 应用并重新打开它。
-
应用再次打开后,摇晃你的设备以显示开发者菜单。按 Cmd ⌘ + D。
-
如果你看到已启用 Fast Refresh,请将其切换。如果你看到 Disable Fast Refresh,请关闭开发者菜单。现在再试着做一次更改。
文件结构
下面,你可以熟悉默认项目的文件结构:
Files
app
Contains the app's navigation, which is file-based. The file structure of the src/app directory determines the app's navigation.
The app has two routes defined by two files: src/app/index.tsx and src/app/explore.tsx. The layout file in src/app/_layout.tsx sets up the tab navigator using the platform-specific AppTabs component.
功能
默认项目模板具有以下功能:
Default project

File-based routing
The app has two screens: src/app/index.tsx and src/app/explore.tsx. The layout file in src/app/_layout.tsx sets up navigation using a platform-specific AppTabs component that uses native tabs on Android and iOS, and Expo Router UI tabs on web.
Learn More