mehcode / rn-splash-screen

A JavaScript-controlled splash-screen for React Native designed to be run directly after the native splash-screen.
MIT License
350 stars 95 forks source link

Render view on top of splash screen? #31

Closed nrathi closed 7 years ago

nrathi commented 7 years ago

Before, when I was using @dbonner1987's code, I was able to render a View on top of my splash screen (in practice, the splash screen had a blue background + text and the View had a loading gif). However, because the background was blue, it would show through when I did opacity transitions.

NSArray *allPngImageNames = [[NSBundle mainBundle] pathsForResourcesOfType:@"png" inDirectory:nil];
  for (NSString *imgName in allPngImageNames){
    if ([imgName containsString:@"LaunchImage"]){
      UIImage *img = [UIImage imageNamed:imgName];

      if (img.scale == [UIScreen mainScreen].scale && CGSizeEqualToSize(img.size, [UIScreen mainScreen].bounds.size)) {
        rootView.backgroundColor = [UIColor colorWithPatternImage:img];
      }
  }
}

Now, using your node module, I no longer see the View on top of my splash screen. Any way to fix this?

Thanks!

nrathi commented 7 years ago

@nezaidu, tagging you just in case you know the answer and will respond quickly :).

nezaidu commented 7 years ago

As far as i am concerned you can hide splash screen any time you want to and then show something else.

nrathi commented 7 years ago

But I wanted to keep the splash screen and then add a gif on top of it. The splash screen has the title of the app and the gif is a loading indicator.

nrathi commented 7 years ago

Maybe this is because @dbonner1987 used a background color but @mehcode uses a loading view...

mehcode commented 7 years ago

But I wanted to keep the splash screen and then add a gif on top of it. The splash screen has the title of the app and the gif is a loading indicator.

I understand what you want. We could probably do something here with a native method exposed in JavaScript. Try adding a second UIImageView in the Show method and composing them to get what you want and then separate it out into a second method we can expose. I don't mind merging that in.

mehcode commented 7 years ago

I'm closing this but I'd still accept a PR to do something.

daviscabral commented 6 years ago

Sorry to bring this dead issue back - but I would like to be sure no one is working and that this is still a valid idea for a PR before I start hacking something.

I am thinking not just a spinner, but a <Text /> (to show the version number - that are interesting in some business apps to be sure users are up to date). Thoughts?