Random Image for Launch Screen

Random Image for Launch Screen

You can set the UILaunchImageFile by a relative path and then put an image at the path and use your random.

For example you change the launchscreen after launching by setting UILaunchImageFile property in the info.plist. You would then write a random image to the Documents folder.

<key>UILaunchImageFile</key>
<string>../Documents/image.png</string>

Random launch-image for iOS and Android

I am going to use a temporary screen to show the splashscreen on react-native side.

On native side, I will be using a image icon.

so that when the app launches, you will see the icon followed by the temp screen followed by your Home screen.

Show random Splash screen

In this case, it's most common to show a "branding" company splash screen, and then once the execution gets into your app (appDidFinish…) putting up a secondary splash screen with your customized/changing/animated image.

iOS - Some images not showing up in launch screen

Turns out that the physical device caches the images regardless if i removed the application or not. The only thing that actually worked was to 1. Remove the application and 2. Reboot the device. Only then the images would disappear. Don't know if this is a bug or not as of iOS 9.2

Generating a random default screen on iOS

You cannot change Default.png. Once the app is shipped - it's "set in stone". Until the next release, that is. The reason is simple (and same why you can't change apps icon). App's bundle is read-only. It is made read only because it is signed by you and by apple. Modifying the contents of the bundle would invalidate the signature.

How to show random splash screen (android)

Create an array with all your drawable ids, use nextInt to generate a value between 0 and length of array.
Then set it as background.

I didn't test it, but it should work fine.

int[] ids = new int[]{R.drawable.yourimage,R.drawable.yourimage2};
Random randomGenerator = new Random();
int r= randomGenerator.nextInt(ids.length);
this.yourImageView.setImageDrawable(getResources().getDrawable(ids[r]));


Related Topics



Leave a reply



Submit