简体   繁体   中英

React Native expo load an image when device is offline

I am trying to load an image when the device is offline. Basically it's an offline notice like bellow image, so the image will only show when the device is offline. I have already referred to expo offline docs https://docs.expo.io/guides/offline-support/ but it's not working I think I am missing something please help me.Show me an example of how to do it.

在此处输入图像描述

1) the image will be available locally in standalone apps if you use assetBundlePatterns , which is enabled by default. see: https://docs.expo.io/guides/preloading-and-caching-assets/#bundling-assets

2) in expo client, if you want it to be available when offline you can cache the image. see: https://docs.expo.io/guides/preloading-and-caching-assets/#pre-loading-and-caching-assets

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM