Startup view for iPad/iPhone with Titanium - iphone

I am building an app with Titanium, where I load a big remote xml file on startup. It shows the usual Default.png splash screen, and then gets to the window, where it says that it's loading. But what I want to do, is to make the splash screen stick until the xml is fully loaded.
Now my approach for this is quite simple, I create an imageView at the start, with the Default.png as the image like so:
var startupView =Titanium.UI.createImageView({
image: 'iphone/Default-Portrait.png',
opacity:1,
zIndex:2
});
and once the xhr.onload function is triggered (meaning the xml file is fully loaded), I fade out this startup view by doing:
var startupAnimation = Titanium.UI.createAnimation({
curve:Ti.UI.ANIMATION_CURVE_EASE_OUT,
opacity:0,
delay: 0,
duration:300
});
startupView.animate(startupAnimation);
This works fine and all, but the problem I have is, that there are different splash screen sizes for different platforms. And so far the app I am creating works well on both platforms. On the ipad the screen is obviously bigger, on the iphone 4, the retina display is also bigger compared to iphone 3gs etc. Therefor I need to come up with something to make this code work nice everywhere.
I tried to check with if (Titanium.Platform.osname == "iphone") { and load the smaller size splash screen for the iphone into the imageview, but somehow it's not the same as the "real" splash screen underneath it. Because of this, the user sees that the initial splash screen and the faked splash screen is shifting. It seems like the default splash screen loaded by titanium is not the same as Default.png, but it's the Default-Portrait.png (which should only be used for the ipad)
I have no idea whether this all is clear, and whether someone here can think with me, but any ideas would be greatly appreciated.

I have done the same thing with a Titanium iPad app. I found that I needed to create my own 'Splash Screen' image without the top 20px where the status bar would be. Because titanium apps can start full screen, the Default-Portrait.png assumes it could be full screen. When you add Default-Portrait.png view in a non-fullscreen app, it shifts it down 20px and you get that 'shifting' effect to the user.
Since you are running on iPhone and iPad, you will probably need to create new splash screens for iPad and iPhone. I would think that you could use the iPhone 4 'fake' image for non retina displays as well and let titanium handle the resizing.

Related

Want to change splash screen every time the app launches in iphone

I am having an app in which I have a requirement of changing the splash screen every time when the app launches.
I am having 5 images and i want to change my splash screen by one of the 5 images every time user launches the app.
Is it possible to do this?
You can't change the splash-screen that shows while your app is loading (that scales up when your app is launched), but you can make it something generic (like a texture or solid colour) then as the first view controller in the app you can load the exact same image (or just use a solid background colour), then you can fade-in one of your five images and show that for a short period before transitioning to the first (real) screen of your app.
For example:
Splash is solid black.
Root view controller gets set to a view with solid black background colour and an image-view containing one of the five images, with alpha set to 0.
Fade in the selected image.
Transition to first-screen of app.
By making the first view controller look exactly like the splash screen (initially) the cut-transition is seamless and your custom transition to your in-app splash screen can begin.
i suggest to leave the splashscreen empty and directly go to another view where you do all the loading and change images there. Changing the splashscreen image at runtime is not possible.
Maybe you can make an image like loading or your logo for the splash screen as this will still pop up for a few seconds.
It's not possible to do what you want. See App Launch (Default) Images. You can only change the Default image based on:
Orientation
Pixel density (retina/non-retina)
Device (iphone/ipad)
URL scheme used to launch the app
Your app data is also read-only so you can't get around this by modifying the Default.png file manually.
Also, it's a very bad idea to not add a Default.png file like some other answers are recommending. You will end up with a black screen for a few seconds, which will also appear in the multitasking switcher if your app has been terminated in the background. This is a very bad user experience and your app will look shoddy.
There is work around for this.
Don't load default Splash Screens.
You can create your own splash screen which will be called every time user open the app.
You can manage the 5 images in this very easily as control will be in your hand.

View for Retina 3.5 displayed like Retina 4

I would like to have an iPhone app only for Retina 3.5. For one of my views I set Size to "Retina 3.5 Fill Screen". I added a toolbar to this view.
However, when I run the app on iPhone 5 the view is displayed Full Screen (like on Retina 4) and the toolbar is somewhere in the middle of the view.
Here are my settings from the XCode:
And here is a screenshot from my iPhone 5:
Any thought how can I make sure that the view is displayed as Retina 3.5 on iPhone 5 ?
Is there any particular reason why you don't want it to work for the 4 inch display? For iPhone five users (at least for me anyways) having an app that isn't built for the larger display is the most annoying thing ever. Those users pay to have more screen real estate and not making an app for them isn't taking advantage of that extra screen real estate. Also, apple made auto layout to be more versatile. This means in the future there are going to be even more screen sizes coming up, so sooner or later you will have to learn how to make the apps behave correctly using auto layout.

iOS startup screen image zooming in?

I'm getting my app ready to submit to the app store and have been reading the guidelines on the startup screen. It seems apple prefer it to be something that makes it look like your app is already loaded even when it isn't.
I decided to use the background image of my app as the startup screen. That way the skeleton of the app will be there and the buttons and text will load in.
I used a copy of the image but renamed it to Default-568h#2x.png.
It works but when it launches, it has that default zoom affect but it seems to zoom in bigger than the actual image size and so doesn't transition nicely into the app.
Any ideas why this happens and what I can do?
Thanks
On the iPhone, the default.png image should contain the status bar (if it is visible in your app).
On the iPad, the status bar shall be left out.
Thus, the default image size should be (source):
This could be an issue with the status bar being included or excluded in the Default images. According to apple all the iPhone Default.pngs should have the status bars included while iPad should have the status bar left out. (Unless of course your application hides the status bar)
OK, I found a way around this.
I found out that the status bar at the top is 40 pixels for retina and 20 for non retina.
I then created a black background in the size of the full iphone 5 resolution. I then got my startup image (actually the background for my app) but resized it down 40 pixels vertically.
I then put this on top of the black background I created and lined up the bottom.
I then merged the layers and used this as the startup image. It worked perfectly, the startup image loads up and then my app opens up right on top of it perfectly aligned.

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.