我正在学习React Native,并在expo中实践它。我已经为我的应用程序做了一个加载屏幕,它使用npm react-native-progress。
有没有办法用我的屏幕替换app.json上expo中的开机画面?我做了一些研究,我发现expo附带了这个默认的启动图像选项。我如何摆脱这个".png图片飞溅“的expo,并在应用程序加载时使用屏幕?如果有,请指导我通过this.Thank你。
发布于 2021-04-10 03:33:52
您可以在应用程序加载时显示进度屏幕:
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
useEffect(() => {
async function prepare() {
await loadAllYourData();
setAppIsReady(true);
}
prepare();
}, []);
return appIsReady ? (
<View>
<Text>My App</Text>
</View>
) : (
<MySplashScreenWithProgressBar />
);
}
https://stackoverflow.com/questions/61357467
复制