Closed mvaivre closed 7 years ago
Don't have the time to do this but would accept a patch from someone to make the example use 9pngs.
a 9 patch image (android/app/src/main/res/drawable/splash_screen.9.png
) works for me.
this is my android/app/src/main/res/values/styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@color/white</item>
</style>
<style name="RNSplashScreen_SplashAnimation">
<item name="android:windowExitAnimation">@android:anim/fade_out</item>
</style>
<style name="RNSplashScreen_SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowAnimationStyle">@style/RNSplashScreen_SplashAnimation</item>
</style>
</resources>
here is what my image looks like. the black border on the right and bottom is important. otherwise you'll have black blocks on the splashscreen.
In the doc, you give a good advice:
I successfully created one folder per screen size and it works well if I use traditional png files, but if I try to use a
splash.9.png
instead, then the file is not recognized.I probably miss something, so don't hesitate to redirect me to an appropriate tuto / stackoverflow answer if it's not related to your package.
Anyway, it would be amazing to update your android example with multiple 9patch splashscreens, to show how it's done... 😊