美文网首页
RN - 关于iOS闪白问题的解决方案

RN - 关于iOS闪白问题的解决方案

作者: iOS_杨平 | 来源:发表于2018-08-23 15:53 被阅读0次

解决方案:https://www.npmjs.com/package/react-native-launch-image

以上一通操作之后编译,仍会报错 RCTBridgeModule.h file not found

解决方法:

1.Build Setting->Header Search Paths 

添加link :$(SRCROOT)/../node_modules/react-native/React

2. 将#import"RCTBridgeModule.h"替换为#import <React/RCTBridgeModule.h>

3.重新编译即可。

小插曲:

import * as launchImage from 'react-native-launch-image';

class App extends React.Component {

    async componentDidMount(){

        launchImage.hide();//勿删这句代码,会导致安卓正常运行,iOS一直保持在启动页,连摇一摇调试菜单都出不来,还以为是iOS突然抽风,各种百度无果,最后检查一下代码发现这句丢了。

    }

}

附:

React Native开发错误警告处理总结(已解决 !持续更新)

Notice:You should not keep launch image more than 5 seconds, which may cause your app got killed by iOS. To do long-time work(like httprequest, which may fail or tooks long), you should first render a reactnative page, then hide launch image before work, or set a timeout, hidelaunch image even if request is still waiting.

相关文章

网友评论

      本文标题:RN - 关于iOS闪白问题的解决方案

      本文链接:https://www.haomeiwen.com/subject/bkcmiftx.html