简体   繁体   English

没有 Expo 的 React Native AppLoading

[英]React Native AppLoading without Expo

I've used expo for a while now and have switched to react-native-init without expo.我已经使用 expo 一段时间了,并且在没有 expo 的情况下切换到 react-native-init。

I've been very comfortable working without expo (thanks Github) but somehow I am unable to find a solution with much googling, for a similar feature to AppLoading in Expo ( https://docs.expo.io/versions/latest/sdk/app-loading ).我在没有 expo 的情况下工作很舒服(感谢 Github),但不知何故,我无法通过大量谷歌搜索找到一个解决方案,用于与 Expo 中的 AppLoading 类似的功能( https://docs.expo.io/versions/latest/sdk /应用程序加载)。 Maybe I'm not using the correct keywords, I keep getting results for react native fast image etc which just preload images from cache.也许我没有使用正确的关键字,我不断得到反应原生快速图像等的结果,这些结果只是从缓存中预加载图像。

I've already set up the Launch screen in Xcode, I would like to network request, load some data into my redux store, preload images and some fonts, before my Launch screen switches to my first screen .我已经在 Xcode 中设置了启动屏幕,我想在启动屏幕切换到我的第一个屏幕之前进行网络请求,将一些数据加载到我的 redux 存储中,预加载图像和一些字体

Can someone provide me with a solution or a link to the solution?有人可以为我提供解决方案或解决方案的链接吗?

react-native-splash-screen满足您的要求!

As of 2021,截至 2021 年,

You may try https://github.com/zoontek/react-native-bootsplash你可以试试https://github.com/zoontek/react-native-bootsplash

In case, react-native-splash-screen is not suitable for you.以防万一, react-native-splash-screen不适合您。

I managed it to just do a simple loading placeholder.我设法只做了一个简单的加载占位符。 While loading you have loadingState == true.加载时,您有 loadingState == true。 If it finished to fetch user data eg it will load your normal screen, navigation or whatever如果它完成了获取用户数据,例如它将加载您的正常屏幕、导航或其他任何内容



  if (loginState == true){
    return(
      <View style={{flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "#000000"}}>
        <Text style={{color: "#FFFFFF", fontSize: 27, fontFamily: "Poppins-SemiBold"}}>Loading</Text>
        <ActivityIndicator size="large" color="#FFFFFF" />
      </View>
    )
  };

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我在我的项目中使用自定义谷歌 fonts 和 AppLoading 时,Expo React Native 项目出现错误。 预先感谢您对我们的支持 - Expo React Native project getting error when I use custom google fonts and AppLoading in my project. Thank you in advance for your support 如何在没有博览会的情况下发布 React Native 应用程序? - how to publish react native application without expo? 在没有 Yarn 的 Monorepo 中使用 Expo React Native - Using Expo React Native in Monorepo without Yarn 有没有办法在没有 expo 的反应原生项目中显示 3d 模型? - Is there a way to display 3d models in a react native project without expo? 在不改变方向的情况下反应 Native Expo 方向侦听器 - React Native Expo orientation listener without changing orientation React Native AppLoading-如何在完全导入本地JSON文件之前停留在加载屏幕上? - React Native AppLoading - how to stay on loading screen till local JSON file is fully imported? 我无法在我的 react native 上使用 apploading。 它不能正常工作 - I can't use the apploading on my react native. It wont work properly 反应本机错误:JSX 元素类型“AppLoading”没有任何构造或调用签名? - React native error: JSX element type 'AppLoading' does not have any construct or call signatures? 如何在 React Native 中延迟 AppLoading? 某些元素的加载速度比其他元素快? - How to delay AppLoading in React Native? Some elements load faster than others? 没有AR模块的expo three.js中的.obj文件如何使用? [React Native Expo] - How to use .obj files in expo three.js without AR module? [React Native Expo]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM