LaunchScreen 之后闪屏一下



  • APP在加载完 IOS的 LaunchScreen 之后 会闪一下白屏,然后再跳转到 其它页面,这个该怎么处理呢?



  • 解决方法是在 RCTRootView 下有一个 loadingView

    /**

    • A view to display while the JavaScript is loading, so users aren't presented
    • with a blank screen. By default this is nil, but you can override it with
    • (for example) a UIActivityIndicatorView or a placeholder image.
      */
      @property (nonatomic, strong) UIView *loadingView;

    通过这个loadingView 在APPDelegate加如下代码

    UIImageView *loadingView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"splash.png"]];
    loadingView.frame = [UIScreen mainScreen].bounds;
    rootView.loadingView = loadingView;