Home > Net >  Resize splash screen image in react-native-bootsplash
Resize splash screen image in react-native-bootsplash

Time:10-19

I'm working on a react native project and I used react-native-bootsplash for my splash screen. The problem is the logo image on the splash screen is too small because the recommended size for the splash screen logo is 100. Is there a way to resize the image or use the @5x image generated by bootsplash??

CodePudding user response:

I found this on react-native-bootsplash's docs (https://www.npmjs.com/package/react-native-bootsplash):

The react-native generate-bootsplash <logoPath> command takes several arguments:

Options:
  --background-color <color>  color used as launch screen background (in hexadecimal format) (default: "#fff")
  --logo-width <width>        logo width at @1x (in dp - we recommand approximately ~100) (default: 100)
  --assets-path [path]        path to your static assets directory (useful to require the logo file in JS)
  --flavor <flavor>           [android only] flavor build variant (outputs in an android resource directory other than "main")
  -h, --help                  output usage information

So if you wanted to create a bootsplash larger than the default size of 100, you could do something like this:

yarn react-native generate-bootsplash assets/bootsplash_logo_original.png \
  --background-color=F5FCFF \
  --logo-width=300 \
  --assets-path=assets \
  --flavor=main

I would just make sure that your logo is of high enough quality so that your bootsplash still looks good.

  • Related