David
David

Reputation: 14404

Dynamically change launch image in iOS

I have a sponsor logo on the launch image. Is there a way to dynamically change the launch image to rotate sponsor logos?

Thanks

Upvotes: 5

Views: 11364

Answers (3)

Suraj Mirajkar
Suraj Mirajkar

Reputation: 1391

As i needed different images on iPhone & iPad Splash screens, i followed below steps:

1. Add two UIImageViews
2. Set Width & Height constants for both UIImageViews as per your requirements.
3. Now select the iPhone UIImageView and set its Height Constraints Regular Regular (RR) height constant as 0.
4. Do the same for for iPad UIImageView and set its Height Regular Regular (RR) height constant as actual required height and set 0 to the Constant. 
5. When you test it on iPhone the iPad ImageView will disappear and vice-versa will happen on iPad. 

enter image description here

enter image description here

Upvotes: 0

Bill Burgess
Bill Burgess

Reputation: 14154

According to Apple's HIG, Human Interface Guide, the splash screen is supposed to be used only as a placeholder to give the user the illusion the app is open while it completes it's startup process.

Apple will allow some use of the startup screen, but know they can and do have the right to reject your app solely on how you use it.

Like the previous answer stated, you could do anything you want after the initial startup screen has passed. Play a video, run an animation, or display a second view with your sponsored images.

And finally, I don't recommend doing this, but if you are determined to work something into the startup screen, you could try this.

The splash screen is hardcoded or set to 1 filename. Before your app closes, you could dynamically replace the hardcoded filename with a new file from a webservice or local storage, replacing the existing splash screen image. I haven't tried this, but it is more than likely possible. Just beware that it may not pass muster with Apple's approval process. Good luck.

Upvotes: 2

PengOne
PengOne

Reputation: 48398

The default image for an iphone app must be a fixed image file in your bundle. You cannot change it dynamically.

However, you can have a dynamic image that appears when the app loads after the launch image. You can set that up with animations or simply to select a random image each time.

Upvotes: 16

Related Questions