React native 如何自定义expo默认启动屏幕并将其隐藏
如何自定义expo默认启动屏幕并将其隐藏在react native中。React native 如何自定义expo默认启动屏幕并将其隐藏,react-native,expo,React Native,Expo,如何自定义expo默认启动屏幕并将其隐藏在react native中。 在安卓系统中,世博会的启动屏幕从屏幕的两侧截取。尽管它在Ios中运行良好。您可以为android和Ios定义不同的Splash,并在每个Splash中为不同的屏幕密度定义不同的Splash。我也能帮忙 您可以在此处看到各种android设备的密度: 下面是我的app.json示例,包含不同的启动文件: { "expo": { "name": "Magic App", "description": "Al
在安卓系统中,世博会的启动屏幕从屏幕的两侧截取。尽管它在Ios中运行良好。您可以为android和Ios定义不同的Splash,并在每个Splash中为不同的屏幕密度定义不同的Splash。我也能帮忙 您可以在此处看到各种android设备的密度: 下面是我的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"
}
}
]
}
}
您可以为android和iOS定义不同的Splash,并在每个Splash中为不同的屏幕密度定义不同的Splash。我也能帮忙 您可以在此处看到各种android设备的密度: 下面是我的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"
}
}
]
}
}
谢谢@Yossi,效果很好。我很高兴!如何在ios中自定义splash?@mikeventoria要自定义默认splash,您必须使用XCode修改ios文件夹中的
.xib
文件。如果您不喜欢这样做,那么另一个选项是使用静态png启动,然后使用类似的屏幕(这是您的应用程序的入口点)通过所有定制/动画等,您可以使用expo的AppLoading
和Splashscreen
组件来控制静态飞溅的行为,并预加载某些资产。谢谢@Yossi,它工作得很好。我很高兴!如何在ios中自定义splash?@mikeventoria要自定义默认splash,您必须使用XCode修改ios文件夹中的.xib
文件。如果您不喜欢这样做,那么另一个选项是使用静态png启动,然后使用类似的屏幕(这是您的应用程序的入口点)通过所有定制/动画等,您可以使用expo的AppLoading
和Splashscreen
组件来控制静态飞溅的行为,并预加载某些资产。