开发者

Dynamically change launch image in iOS

I have a sponsor logo on the l开发者_如何学编程aunch image. Is there a way to dynamically change the launch image to rotate sponsor logos?

Thanks


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.


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.


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. 

Dynamically change launch image in iOS

Dynamically change launch image in iOS

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜