启动画面和应用图标
了解如何向 Expo 项目添加启动画面和应用图标。
启动画面和应用图标是移动应用的基本元素。它们在应用的用户体验和品牌建设中起着重要作用。本指南提供了创建和添加这些元素到应用中的步骤。
🌐 A splash screen and an app icon are fundamental elements of a mobile app. They play an important role in the user experience and branding of the app. This guide provides steps on how to create and add them to your app.

查看关于如何为 Expo 项目创建应用图标和启动屏幕的详细指南。
启动画面
🌐 Splash screen
启动画面,也称为开屏,是用户打开应用时看到的第一个屏幕。在应用加载时,它会保持可见。你还可以使用本地的 SplashScreen API 来控制启动画面消失的行为。
🌐 A splash screen, also known as a launch screen, is the first screen a user sees when they open your app. It stays visible while the app is loading. You can also control the behavior of when a splash screen disappears by using the native SplashScreen API.
expo-splash-screen 内置了一个 配置插件,可以让你配置启动图标和背景颜色等属性。
🌐 The expo-splash-screen has a built-in config plugin that lets you configure properties such as the splash icon and background color.
1
创建启动画面图标
🌐 Create a splash screen icon
要创建启动画面图标,你可以使用这个 Figma 模板。它提供了一个最基本的图标设计以及适用于 Android 和 iOS 的启动画面图片。
🌐 To create a splash screen icon, you can use this Figma template. It provides a bare minimum design for an icon and splash images for Android and iOS.
推荐:
- 使用 1024x1024 的图片。
- 使用 .png 文件。
- 使用透明背景。
2
将启动图标导出为 .png
🌐 Export the splash icon as a .png
在创建启动屏图标后,将其导出为 .png 文件并保存到 assets/images 目录中。默认情况下,Expo 使用 splash-icon.png 作为文件名。如果你决定更改启动屏文件的名称,请确保在下一步中使用该名称。
🌐 After creating a splash screen icon, export it as a .png and save it in the assets/images directory. By default, Expo uses splash-icon.png as the file name. If you decide to change the name of your splash screen file, make sure to use that in the next step.
注意: 目前仅支持 .png 图片 作为 Expo 项目的启动屏幕图标。如果使用其他图片格式,应用的生产构建将会失败。
3
配置启动画面图标
🌐 Configure the splash screen icon
打开应用配置文件,在插件下设置以下属性:
🌐 Open the app config file, and under plugins, set the following properties:
{ "expo": { "plugins": [ [ "expo-splash-screen", { "backgroundColor": "#232323", "image": "./assets/images/splash-icon.png", "dark": { "image": "./assets/images/splash-icon-dark.png", "backgroundColor": "#000000" }, "imageWidth": 200 } ] ] } }
要测试你的新启动屏幕,请将应用构建用于内部分发或生产版本,详见Android和iOS指南。
🌐 To test your new splash screen, build your app for internal distribution or for production, see guides on Android and iOS.
了解 SplashScreen API 的可配置属性。
为 Android 和 iOS 分别配置 expo-splash-screen 属性
[expo-splash-screen](/versions/latest/sdk/splash-screen) 还支持 android 和 ios 属性,用于配置特定平台的启动画面。请参见以下示例:
{ "expo": { "plugins": [ [ "expo-splash-screen", { "ios": { "backgroundColor": "#ffffff", "image": "./assets/images/splash-icon.png", "resizeMode": "cover" }, "android": { "backgroundColor": "#0c7cff", "image": "./assets/images/splash-android-icon.png", "imageWidth": 150 } } ] ] } }
不使用预构建吗?
如果你的应用没有使用 Expo Prebuild(以前称为 托管工作流程)来生成原生的 android 和 ios 目录,那么应用配置的更改将不会生效。欲了解更多信息,请参阅 如何手动自定义配置。
🌐 If your app does not use Expo Prebuild (formerly the managed workflow) to generate the native android and ios directories, then changes in the app config will have no effect. For more information, see how you can customize the configuration manually.
故障排除:iOS 上未显示新的启动画面
对于低于 52 的 SDK 版本,在 iOS 开发构建中,启动屏有时可能会在构建之间被缓存,这会使测试新图片变得更加困难。Apple 建议在重新构建之前清理 derived data 目录,这可以通过运行 Expo CLI 来完成:
🌐 For SDK versions below 52, in iOS development builds, launch screens can sometimes remain cached between builds, making it harder to test new images. Apple recommends clearing the derived data directory before rebuilding, this can be done with Expo CLI by running:
- npx expo run:ios --no-build-cache有关更多信息,请参阅 Apple 的启动屏幕测试指南。
🌐 See Apple's guide on testing launch screens for more information.
应用图标
🌐 App icon
应用的图标是用户在设备主屏幕和应用商店中看到的内容。Android 和 iOS 有不同且严格的要求。
🌐 An app's icon is what your app users see on their device's home screen and app stores. Android and iOS have different and strict requirements.
1
创建一个应用图标
🌐 Create an app icon
要创建应用图标,你可以使用这个 Figma 模板。它提供了一个图标和 Android 及 iOS 启动画面的最基本设计。
🌐 To create an app icon, you can use this Figma template. It provides a bare minimum design for an icon and splash images for Android and iOS.
2
将图标图片导出为 .png
🌐 Export the icon image as a .png
创建应用图标后,将其导出为 .png 并保存在 assets/images 目录中。默认情况下,Expo 使用 icon.png 作为文件名。如果你决定使用不同的文件名,请确保在下一步中使用该文件名。
🌐 After creating an app icon, export it as .png and save it in the assets/images directory. By default, Expo uses icon.png as the file name. If you decide to use a different file name, make sure to use that in the next step.
3
在应用配置中添加图标
🌐 Add the icon in app config
打开应用配置,并将本地路径添加为 icon 属性的值,以指向你的新应用图标:
🌐 Open the app config and add the local path as the value of icon property to point it to your new app icon:
{ "icon": "./assets/images/icon.png" }
Android 和 iOS 的自定义配置技巧
安卓
🌐 Android
可以使用 android.adaptiveIcon 属性进一步自定义 Android 图标,这将覆盖之前提到的两个设置。
🌐 Further customization of the Android icon is possible using the android.adaptiveIcon property, which will override both of the previously mentioned settings.
Android 自适应图标由两个独立的图层组成——前景图片和背景颜色或图片。这使操作系统可以将图标裁剪成不同的形状,同时也支持视觉效果。在 Android 13 及更高版本中,操作系统支持使用壁纸和主题来确定由设备主题设置颜色的主题应用图标。
🌐 The Android Adaptive Icon is formed from two separate layers — a foreground image and a background color or image. This allows the OS to mask the icon into different shapes and also supports visual effects. For Android 13 and later, the OS supports a themed app icon that uses a wallpaper and theme to determine the color set by the device's theme.
你提供的设计应遵循Android自适应图标指南用于启动器图标。你还应该:
🌐 The design you provide should follow the Android Adaptive Icon Guidelines for launcher icons. You should also:
- 使用 .png 文件。
- 使用
android.adaptiveIcon.foregroundImage属性来指定前景图片的路径。 - 使用
android.adaptiveIcon.monochromeImage属性来指定你的单色图片的路径。 - 默认的背景颜色是白色;要指定不同的背景颜色,请使用
android.adaptiveIcon.backgroundColor属性。你也可以使用android.adaptiveIcon.backgroundImage属性来指定背景图片。确保它的尺寸与前景图片相同。
你可能还希望为不支持自适应图标的旧版 Android 设备提供一个单独的图标。你可以使用 android.icon 属性来实现。这种单独的图标将是前景层和背景层的组合。
🌐 You may also want to provide a separate icon for older Android devices that do not support Adaptive Icons. You can do so with the android.icon property. This single icon would be a combination of your foreground and background layers.
请参阅 Apple 最佳实践 以确保你的图标看起来专业,例如在不同的壁纸上测试你的图标,并避免在产品商标旁边添加文字。请提供至少 512x512 像素的图标。
iOS

了解如何使用新的图标制作器为 Expo 项目创建应用图标。
对于 iOS,你的应用图标应遵循 Apple 人机界面指南。你可以使用 Icon Composer 应用来创建你的应用图标。这将生成一个 .icon 目录,你可以将其添加到项目的 assets 目录中。然后,你可以在应用配置中提供该目录的路径。在 Icon Composer 中可以处理夜间模式的支持,因此使用这种方法时无需提供变体。
🌐 For iOS, your app's icon should follow the Apple Human Interface Guidelines. You can use the Icon Composer app to create your app icon. This will output a .icon directory that you can add to your project's assets directory. You can then provide the path to this directory in your app config. Adding support for dark mode is handled in Icon Composer, so you do not need to provide variants when using this approach.
信息 注意: 通过
ios.icon提供 Icon Composer .icon 目录在 SDK 54 及更高版本中受到支持。
{ "expo": { "ios": { "icon": "./assets/app.icon" } } }
另外,之前提供图片的方法仍然支持。你应该:
🌐 Alternatively, the previous approach of providing an image is still supported. You should:
- 使用 .png 文件。
- 1024x1024 是一个合适的大小。如果你使用
npx create-expo-app创建了 Expo 项目,EAS Build 会为你生成其他尺寸的图标。如果是 bare React Native 项目,则需要你自己生成图标。EAS Build 生成的最大图标尺寸为 1024x1024。 - 图标必须完全是正方形的。例如,1023x1024 的图标无效。
- 确保图标填满整个正方形,不要有圆角或其他透明像素。操作系统会在合适的时候对你的图标进行遮罩处理。
- 使用
ios.icon可以为不同的系统外观(例如深色和带色调)指定不同的图标。如果指定了,它将覆盖应用配置文件中的顶层图标键。请参见下面的示例:
{ "expo": { "ios": { "icon": { "dark": "./assets/images/ios-dark.png", "light": "./assets/images/ios-light.png", "tinted": "./assets/images/ios-tinted.png" } } } }