如何自定义expo默认启动屏幕并将其隐藏为本地react



如何自定义expo默认启动屏幕并将其隐藏在react native中。世博会的飞溅屏幕被削减从屏幕的两侧在安卓系统。尽管它在爱荷华州运行良好。

您可以为android和iOS定义不同的splash,并且在每个splash中,针对不同的屏幕密度定义不同的Splash。resizeMode也有帮助。

你可以在这里看到各种android设备的密度:https://material.io/tools/devices/

这里是我的一个示例app.json,有不同的启动文件:

{
"expo": {
"name": "Magic App",
"description": "All the important information about my Pet",
"slug": "magicapp",
"privacy": "public",
"sdkVersion": "31.0.0",
"platforms": [
"ios",
"android"
],
"version": "0.43",
"orientation": "default",
"icon": "./assets/images/icon.png",
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.yossi.magicapp",
"splash": {
"image": "./assets/images/splash-ios.png",
"tabletImage": "./assets/images/splash-ios-tablet.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
}
},
"android": {
"package": "com.yossi.magicapp",
"versionCode": 1,
"permissions": [
"CAMERA",
"CAMERA_ROLL",
"READ_INTERNAL_STORAGE",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
],
"splash": {
"ldpi": "./assets/images/splash.png",
"mdpi": "./assets/images/splash.png",
"hdpi": "./assets/images/splash.png",
"xhdpi": "./assets/images/splash.png",
"xxhdpi": "./assets/images/splash.png",
"xxxhdpi": "./assets/images/splash.png",
"tabletImage": "splash-android-tablet.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"icon": "./assets/images/icon.png",
"adaptiveIcon": {
"foregroundImage": "./assets/images/icon-oreo.png",
"backgroundColor": "#15b3bf"
}
}
},
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "self-dm",
"project": "magicapp",
"authToken": "0ca29a9ed2e84e86bbac3e0e81b6e1ac208cf77f08ef48f9b28732d028e50cf6"
}
}
]
}
}

最新更新