Dynamically change launch image in iOS - iphone

I have a sponsor logo on the launch 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.

Related

UiButton don't size correctly with Canvas

I have a problem when I try to change screens , from iPhone X pro to iPhone 8 ( landscape mode). The button don't resize correctly when I make the change.What should I add to the Canva or buttons to get a better size.(Same issue for the panels)
CanvaInspector
ButtonInspector
First of all, if you want your application to just work in landscape mode, then you can set the Reference Resolution as X:1080 Y:1920, set the Match value as 1 (this is based on how you want your UI to react, so you may want to keep it as 0), set your preview screen size as 1920x1080 Landscape, and try to build your application based on that reference, it will make most of the things easier. Furthermore, if you anchor your UI elements properly, it will react to different resolutions without any problem. For the anchors and pivots, you may want to take a look at the unity documentation for basic layout.
However, if you want your application to work in both portrait and landscape mode, then the general idea is more or less the same, you may want to play with your reference resolution and match value (for example, setting the match value as 0.5 will make the UI resize by considering both height and width equally). This documentation can help you to understand it better.
I also know that some developers design different UIs for landscape and portrait mode separately and then activate/deactivate them based on the orientation of the phone. This can also be an option.

Custom app background on launch image [ios 4 & 5]

my iOS application has the option to change the background image, there are 3 different background patterns available, and the user can select any of them.
The problem is the launch image, reading the iOS HIG it is supposed to be an image similar to the GUI (first 'window') of the application. Is it possible to load a different image depending on a user prefference (the background pattern selected)?
Thanks!
It is not possible to do so - you can only have one default.png, and you can't alter it programmatically before the app starts. I'd recommend simply creating a splash screen different from the app's background. Note that the iOS HIG is a Guideline not a requirement.
It is not possible. Default.png needs to be set when you compile.
You cannot change the Launch Image during app launch (or anytime during App execution). The way to handle this (realizing that you might be violating the HIG) is to present your own image directly after applicationDidFinishLaunchingWithOptions, and leave the Launch Image as either an intermediate image or blank.

iPhone app Launch Image with different backgrounds

This question is similar to this one. My iPhone app allows the user to select the background image to use for the main screen. Therefore, depending on the background image selected by the user, the Launch Image screenshot (of the main screen) will likely display the wrong background image. When the main screen is finally loaded and the Launch Image is removed, it will be quite ugly for the background image to change suddenly to what the user has selected.
Does anyone have any suggestions on how to deal with this? Should I use some kind of splash screen (I thought I read in Apple's HIG that this was not allowed)? Or maybe I should somehow "transition" the user's selected background image into the view after the Launch Image is dismissed and the main screen is visible. Any thoughts?
If you really want to show a 'Splash' Image what you could do is forget about dynamically changing Default.png and use a simulated splash screen effect (simply a UIView or UIImageView covering the entire screen) which disappears after a number of seconds. What you need to ensure is you do the minimal amount of work to show the simulated splash screen and get it on the screen as fast as possible and then do any other computations later on whilst your image is shown.
There is no way you could change the actual Default.png without having the risk of your app being rejected by Apple.
Depending on how long your application takes to launch, you can use a black image as default.png. A "splash screen" isn't recommended but if there is no generic image possible and your app takes a significant amount of time to launch, it would be a better approach for the user's perspective as they would at least know that the application is launching.
Also remember that default.png is only shown when your app first launches, not when it resumes from multitasking (unless it has since been killed off).
See also this question Changing UIView when applicationWillEnterForeground fires which will be the next issue you face if your background image is set in preferences rather than within the app!

Wrong iPhone launch image displayed when iPhone app is launched on iPad

I have developed a straight iPhone/iPod Touch app.
A launch image is implemented for Retina displays as well as the lower resolution of the former generation devices.
Those images are displayed properly on the iPhone simulator as well as on several iPhone an iPod Touch devices.
However, since some days, when launched on an iPad (1) or iPad simulator one of the other images within the app is shown.
Apparently the image that is displayed wrongly, is one of two amongst ca. 70 images within the app. Those two images happen to be either
1. the first image in my xcode project groups hierarchy.
-or-
2. the first image in my project in alphabetical order.
I did not yet find a pattern of when 1. or 2. happens, so when the first image in the project's hierarchy of groups is taken or when the first in alphabetical order is taken. But it seems to be one of these two files only.
Any idea what I probably did wrong so that a wrong image is picked as launch image of this iPhone-only app whenever it is launched on an iPad?
Thanks in advance.
Cheers
Hermann
Try inserting an image named Default.png into Xcode. That's all, just drag it in. Xcode recognizes any picture named Default.png as the loading image. That should make it work.
To expand a little on Jack's answer - you can indeed use an image named Default.png which will automatically be used as a launch image for your app.
However,you can also customise the launch image for particular hardware and device orientations by using images of a particular size and name - for example, a 768x1004 pixel image named Default-Portrait~ipad.png added to your project will be automatically used as the launch image when you launch the app on an iPad in portrait orientation.
The use of these customised images is highly recommended, as it allows the launch image to be sized appropriately for the different shapes of screen (i.e. iPhone and iPad), and allows high resolution launch images to be used on Retina display devices.
For a list of these sizes and image names, see this page. The items of interest are the ones beginning with "Default"
All iPhone apps have a splash screen, or what Apple refers to as a “launch image”. It is the screen that is displayed immediately after you press your app’s icon on the home screen, while the app icons are sweeping away and your app is zooming into view.
Some apps opt not to display a splash screen and go for a black screen, which is the default behaviour when you create an app. Others display a wireframe of the app’s interface in order to look like it is loading faster. See Apple’s native apps such as Clock and Camera for good examples of this. The most common use of the splash screen (especially in games) is to present a company or game logo, as we do in Addicus:
Apple has made it so easy to set your splash screen that you don’t even need a single line of code to do it. Why, you don’t even need to change a setting. Here’s how to set your splash screen it in just 2 steps:
Add a file to your project’s Resource folder called Default.png.
There is no step 2. Take this time to reflect on how good life is.
And that’s it. Run your app and your splash screen will zoom into glorious view.
A couple of things to watch out for when working with splash screens:
Whatever image you give it will be scaled to fill the 320×480 resolution of the iPhone, so ideally you would use a 320×480-sized image.
If your iPhone app is running in landscape mode, you need to rotate the splash screen you use. For example, our splash screen is rotated 90 degrees to the right in the above image.
See more at: http://getsetgames.com/tag/launch-image/#sthash.GEXwuzsf.dpuf

Best way to create Default.png image for iPhone app

Originally I though I'll just take a screenshot of my app on the iPhone then tweak it in Photoshop.
The images should be 480 x 320 according to Apple doc, and the dimensions of my screenshot are 480 x 320. But, the screenshot contains notification area (where reception bars, battery life, etc. are displayed)
So, if I chop that part off my image will be a bit shorter and not 480px high.
What do I do? Submit a shorter image? Stretch it up so it's 480px but without the notification bar? Submit it with the notification bar in the image?
How did you create your Default.png?
There is support in Xcode for creating the default image. With the device connected, open the Organizer (Window > Organizer). Click the Screenshot tab, take a screenshot and click "Save as default image..." Choose your project and bingo jingo, you're done.
You can leave the notification area in the screenshot. The iPhone will draw the real notification bar over it.
iOS 7 update: the iOS 7 Transition Guide explicitly requires this:
Update the launch image to include the status bar area if it doesn’t already do so.
I think the best way to do it is to use the Xcode screenshotter & edit some of the GUI elements out, like the artwork or text on your buttons so people don't get frustrated when pushing 'buttons' on the Default.png doesn't make your app respond.
If you have a status bar, then you should design 320x460 (less 20 pixels).
Though it is correct that you can leave it at 320x480 and have the real status bar paint over the default.png, it will look weird when the phone is in Internet tethering mode or has a call on hold (another 20 pixels).
By cropping to 320x460, it looks better when in tethering mode.
Just edit out the notification area to match the background of the rest of the image. As long as your image is 480x320 you should be fine.
However, if your app takes more than a few seconds to load, you may want to rethink using a screenshot of your app as the startup screen. People might get confused and think the app is finished loading, when in fact it is not. I've seen some apps produce a "stylized" version of their UI in Photoshop, making it clear that it's just an image and not the actual UI.
you should remember that you maybe need also some space for an In-Call status bar or the Tethering status bar. this bar has a height of 20 pixels. Even apple does not make it right. Put a call on hold and start "Photos" or the "Weather" app, then you can see what I mean. To test that you can use the menu "Toggle In-Call Status Bar" in the iPhone Simulator app.
you can use a real 480x320 image if you add the boolean key UIStatusBarHidden to your Info.plist file and set it as true.
Take a screen shot as many of the answers already mention. However, if your screen shot includes the status bar, you should remove it/replace it with a transparent strip instead. It is true that the iPhone will cover this part of Default.png with the current status bar however, if you run the iPhone app on the iPad, you will still be able to see this part of Default.png.
I built a slightly modified version of the initial view in IB, ran the app with that and took a screen shot. That way, everything looks very iPhoney, no Photoshop needed. Don't worry too much about clipping the top, it will mirror how the view actually looks when loaded if more stuff covers it.
Apple recommends something similar to what the user will see when the app loads. E.g. for my Sudoku app, instead of the grid, the default.png shows a "please wait" message. When the app is loaded, that disappears and you see the grid you can interact with. It looks fluid, and it's obvious when it's loading and when you can interact.
Finally, the interface uses some toolbar buttons. In the default.png they are in the disabled state (grey text). When the app is loaded, they are enabled and change color.