Two status bars at iPhone app startup - ios

This makes no sense, but suddenly one of the iPhone (iOS 5.0 target) apps I'm developing starts up with two (2) statusbars! Furthermore it's not always, only with some installs with some people.
This is the only related question I could find: Why do I see double status bars when starting my app?
App has three default.png files, all created by opening iPhone simulator and taking a screenshot. The files were drag & dropped into project target "Launch Images" section. No yellow warning triangles, so everything should be ok:
Default.png 320 x 480 (iPhone simulator)
Default#2x.png 640 x 960 (iPhone Retina 3.5-inch simulator)
Default-568h#2x.png 640 x 1136 (iPhone Retina 4.0-inch simulator)
Any ideas what could be wrong? Apple docs seem to say this setup is correct - but now even I started to see 2 statusbars at startup!
Update:
Getting crazier! I edited first two files - and saved without edits as-is. Problem fixed. Same with third image - problem remains !!! iPhone Retina 4-inch simulator was started using 3.5-inch launch image !!!
Yep, I labelled the pics. With different numbers.
So first two cases might have been some image file format issues and the third case looks like Apple defect. Any other guesses?
Xcode project target summary has Default-568h#2x.png image in box, it's the real image with correct number, and there is no yellow warning sign. That file does exists in file system, is in same folder as the two other ones and is included in "Copy Bundle Resources" build phase. What else can I check?

I'm not sure why this would be happening irregularly, but I think I have an idea. When you said that you took your screenshots with the iOS simulator, the status bar may have been saved as part of the image. Then, iOS is showing your Default.png squished down by 20px creating the illusion of two status bars during launch.

Related

iPhone X: Incorrect launch-screen orientation used

I am testing image launch-screens on the iPhone X and ran into a strange behavior. So I'd like to request some feedback before opening a radar:
I created a portrait and landscape launch-screen with the dimensions 1125 x 2436 Pixel (portrait) and 2436 x 1125 Pixel (landscape). Then I add them to the asset catalog and they are picked up correctly:
So far so good. Then I run the app on the iPhone X Simulator (I've reset the app before to ensure nothing is cached) and the (stretched) landscape-image is shown.
I validated the png sources to have a valid non-alpha background and am still unable to show the correct launch-screen. I noticed that the portrait image is not even copied to the resulting product:
So that might suggest an issue with Xcode 9. Any feedback is more than welcome, thanks guys!
EDIT: Side-note: When removing the landscape image from the asset-catalog, the portrait one is copied and picked up correctly.
UPDATE 09/29/2017: Apple confirmed that it is indeed an issue in Xcode and it will be given to the related engineering-team.
For the iPhone X, try using a launch screen storyboard instead of launch images.
This is mentioned in the new "Building Apps for iPhone X" video on Apple's developer site: https://developer.apple.com/videos/play/fall2017/201/
(It's mentioned at the 2:50 mark.)
To set a launch screen storyboard, create a storyboard file and choose it from the "Launch Screen File" dropdown in your project settings.
This is finally fixed in Xcode 9.1 Beta 2 and above!
Using only the portrait image (and no landscape one) seems to work, at least on the simulator. Anyhow, iPhone X can launch apps only from portrait. Don't know if this solution will create issues on the actual device (iPhone X isn't available yet at time of this writing). I would guess it doesn't.
This is clearly an xCode 9 bug, i've the same problem, also the filename of the asset is not correct, following previous naming convention there must be 2 files, LaunchImage-1100-Portrait-2436h#3x.png and LaunchImage-1100-Landscape-2436h#3x.png (note why 2436h and not 812h, all the others resolution are expressed in point not pixel)

iOS 9 Splash screen is black

My apps' splash screens are all plain black after upgrading to iOS9.
Does anybody know why this is? Some of them are using a .xib splash screen and some are using images, but they're all just black now. Does an app have to be built with Xcode 7 for the splash screen to work in iOS9? Has anyone seen some documentation on whether this is an intended breaking change from Apple?
Thank you!
UPDATE: Looking through the apps again it seems my older apps, which only had a Launch image and no .xib are still displaying correctly, so the issue seems related to the launch screen .xib
UPDATE2:
As hagi pointed out in the comment, after re-installing the very same binary it starts working again so the cause is probably that launch images are generated from the xib whenever the app is installed, and stored somewhere, and then when upgrading to iOS9, for some reason (unintended Apple bug most likely), the generated images are cleared, and the app ends up with no splash. And that's why the old-fashioned launch images are still safe and not affected by this, cause they're already baked into the app.
I'll report it as a bug to Apple.
Easy fix. No need to mess with anything. Xcode 7 just prefers the images to be "Universal".
Click on Assets.xcassets folder
Click the + sign to Import from Project.
Select all images
Done. Now your launch screen works and Xcode is happier.
Same problem here after I updated to iOS 9. Re-installing the app from the App Store seems to solve the problem. I guess, it's an iOS 9 glitch.
I had the exact problem and had a black launch screen after using Xcode 7, and at first re-adding the images in Launch-Screen.xib worked but it went black again.
I fixed this permanently by moving the images referenced by Launch-Screen.xib into an asset catalog, rather than using the png filenames.
Just to point out that once again (as this solution didn't appear in answers, and I've personally lost around two hours when "fixing" that), sometimes, especially when the app is in active development/debugging, it requires iOS device to reboot for the launch screen to be fixed.
Black screen default come because, iOS strictly enforces some a startup images it can be black or any images.
Use UILaunchImages key to the Info.plist file and use a dictionary to describe each launch image.
check following references
A launch storyboard or xib must be provided unless the app requires full screen
I am using xcode7.1 it works. Please download latest xcode7.1
I hope above information will help you.
In the storyboard 'Clears Graphics Context' box unchecked then It works.
What worked for me was
1 - Go to LaunchScreen.storyboard
2 - Select is the initial view controller
enter image description here
And you are good to go.
With me uninstalling the app, or rebooting the device didn't help. I used XCode for 5 more minutes, which is the mean time between failure in XCode and it gave "Unkown error occurred" error, which was very helpful. Of course as an experienced XCode developer I knew what to do, force-quit, clean the project, rebuild.
The first error was solved meanwhile as I had forgotten about that.
The problem maybe because missing image size: .png, #2x.png, #3x.png at LaunchScreen.xib
I made loading screen by LaunchScreen.xib
In this xib has load a image launch.png
But there are missing size launch.png, just exist launch#2x.png and launch#3x.png
After add missing image: launch.png, black square bug is gone.
Starting from iOS9 and Xcode 7 you are required to provide a LaunchScreen.storyboard for your launch screen in order to support the new multitasking feature on iPad.
To opt out of being eligible to participate in Slide Over and Split View, add the UIRequiresFullScreen key to your Xcode project’s Info.plist file and apply the Boolean value YES.
I have fixed this issue after removed Size Classes for LaunchScreen.xib
I used only Auto Layout for it.
I noticed the same issue on the launch screen and have a black square in the middle of the screen.
It might be due to missing images at the specified formats .e.g #2x, #3x etc.
I had the same problem. I downloaded Xcode 7 and upgraded my project to swift 2.0. After recompiling the issue was gone at first but then it started to happen again later on during my tests on other unrelated code.
So far two things get this fixed, in both cases temporarily. Remove the background image, add the same image with another name. New image works for a while. Second, is you resize the image view, and in most cases the image starts to work again, but only for a while.
I submitted my new update to iTunes connect while I was seeing the splash screen. Not sure if this is an operating system issue or app api issue that gets corrected with a recompilation of code.
I also tried enabling and disabling the new Bitcode feature but that didn't help.
I had the same issue with the new iOS 9 project I built using Unity (5.2). To fix that I added the image that I want to show as the launch image to the LaunchScreen-iPad.xib file's Image view.
The common solution of adding the Images in LaunchImage and setting it in Launch Image Source and deleting the entry in Launch Screen File did not solve my issue. The launch image is dependent on the iPhone you are using. Since my app was for iOS 8.0 and greater, choosing it in LaunchImage will ask you to upload only Retine 4.5" and Retina 5.5" images. But these sizes will work for iPhone 6 and 6 Plus. You should upload the images based on the device.
iPhone 4S:640 x 960 (#2x)
iPhone 5:640 x 1136 (#2x)
iPhone 6: 750 x 1334 (#2x) portrait, 1334 x 750 (#2x) landscape
iPhone 6 Plus: 1242 x 2208 (#3x) portrait, 2208 x 1242 (#3x) landscape
I wasted so much time solving the black screen launchimage issue. Hope this helps someone.
We always need to add proper size of image if we are using image.Assets for Launch image and select correct options for launch image Source on Clicking project navigator>General>AppICons and launch images > launch image Source > BrandAssets
If size of launch image is not correct with respect to device on which you are try to running app, then your app will run as iPhone 4 showing black top and bottom bars.
Resizing the image and changing the format to png fixed it for me :
Resize the images (1x => 500 × 825) (2x&3x => 600 × 991)
Change to png
Clean building folder and Derived Data
Restart xcode and simulator

#3x images incorrectly used on iPhone 6 or 5S or 5 in XIB's with the "Use as Launch Image" option set

With-in a clean brand new iOS project I've:
added 2 images to the project "background#2x.png" and "background#3x.png"
added a XIB named "LaunchScreen.xib"
checked the XIB's "Use as Launch Screen" option
added a UIView sub-view to LaunchScreen.xib and set its image name to "background.png"
with-in the project settings, under the targets 'General' settings I've set the 'Launch Screen file' to "LaunchScreen"
Now when I launch the app on any of the devices list below the #3x image is displayed in the resulting launch screen when surely the #2x image should be used.
Problem devices (that all use the #3x resource):
iPhone 5 (iOS 8.0.0)
iPhone 6 (iOS 8.0.0)
iPhone 6 (iOS 8.0.2)
iPhone 5 Simulator (iOS 8.0.0)
iPhone 6 Simulator (iOS 8.0.0)
NOTE that the #2x image is distinctive from the #3x image so I can easily identify which one is being used.
At first I assumed this was a bug with the simulator and was staggered when it occurred on a real device also.
I assume this is yet another iOS8 bug however I guess there's also the possibility that its expected behaviour as the result of the launch screen being cached as a static image of some kind.
Any ideas or potential solutions?
EDIT:
For the benefit of others, I have subsequently found that if the images are instead added to an Images.xcassets image set then the correct behaviour is in-fact observed. HOWEVER this is not an ideal solution for us since we have a very specific image export process which means we are not using an Images.xcassets in out project (there are thousands of images in the app).
I have now also raised a Radar with Apple #18513968
http://openradar.appspot.com/18513968
I've just tried this myself, and get the same behaviour you have mentioned.
By setting the Launch Images Source to "Use Asset Catalog", and adding the Launch Image you can get each device to show its specific background. Some screenshots can be seen here:
Supporting iPhone 6 and iPhone 6+ with different launch/splash screen image for iPad Portrait and Landscape orientations
Looking into it a bit more, I found a website that mention:
http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
"You can use the new adaptive UI features in Interface Builder to fit your layout to different screen sizes. If your scene requires screen-size-specific images, use asset catalogs to define different images per size class."
Maybe that is the only way to do it.

How do I specify an iPad Retina icon in XCode 4.3 for an iPhone-only app?

My iPhone app icon shows up fine in iPhone/Retina and iPad. But on iPad retina (simulator and device) I get an icon that apparently contains the app's start screen:
Given that my app is designed for iPhone only (not 'Universal'), there is no option in Xcode 4.3 to add an iPad retina icon.
How can I get my app's icon to display correctly on iPad Retina devices?
In Xcode the target summary interface where you add your icons and launch images is merely a graphical interface to the Info.plist file. When you make a iPhone only target, the graphical interface for the iPad portion is hidden. To add information to the Info.plist file that isn't covered by the graphical interface move to the Info tab and enter it there. To add the Retina iPad icons add an icon named Icon-72#2x.png and Icon-Small-50#2x.png to the Icon files array in the Info section. Also add actual 144 x 144 and 100 x 100 png representations of your icon with the proper name to your Xcode project and the target.
I've just had this problem with an app too, and when I went to edit the Info.plist file found that Default#2x.png was in the icon list - no idea how it got there, but this project has been going on a while so could be a result of one too many XCode upgrades.
Removing it from the entries in the plist has fixed the problem on the retina iPad too. Am still going to add the extra iPad icons in just in case, but if others are having the problem it is worth checking what XCode has put in those entries.

On Xcode 4.3.1 4E1019, Launch screen (Default.png, etc) has white line (1 pt tall) at bottom of image on launch

This is odd. I have a Default.png, Default-Landscape.png, Default-Portrait.png and Default#2x.png.
The normal "default screen zoom animation" is where the Default.png zooms from the center of the screen out "into" place. This happens with all apps on iOS so this is the time when you can really see that white-line on the bottom of the "Default" image. It is a 1 pt (or so) line, going from left-to-right at the bottom of all my Default.png's (Default#2x.png, Default-Landscape.png, etc)... It occurs on both of my devices: "iPhone 4" and "iPad 1". It does NOT occur on any of the simulators.
The images have not changed between my builds. Indeed, last week I built an earlier version (with the same launch graphics) and this did not happen.
The images are the correct size. I even changed the .ipa to a .zip, uncompressed and looked in the package. The pngs are the correct size, so nothing killed that.
When I revert back to the AdHoc from the last build of my app, the issue goes away. When I move to the current build, the issue comes back.
Any ideas?
BTW: Addendum: I grabbed my old source code (for the version that is okay), compiled with Xcode 4.3.1 and have the same issue. white line on the bottom of the launch screen.
Addendum
Okay, well one thing we noticed:
Our PNGs for ipad were 1024x768 and 768x1024 instead of 1004x768 and 748x1024
We fixed that (weird that they worked before) and iPad launch was fixed and displays properly. iPhone is still broken.
the iOS Human Interface Guidelines/ Custom Icon and Image Creation Guidelines says iPhone are supposed to be 320x480 and 640x960
I must've gotten confused when i originally created iPad graphics, but they have been working up until XCode 4.3.1!!! (2 years!) I know my iPad sizes were off, but wonder what made XCode change this and decide they were borked now?
This is the same issue as:
iOS 5.1 : -[UIColor colorWithPatternImage:] background color draws solid black
Basically: iOS 5.1 fails to decode the last line of pixels in an indexed-color PNG (PNG8) or any grayscale PNG.
The workaround is to use PNG32, or add dummy lines to the end of the PNG8.
I filed a bug with Apple (#11069678) and advise you to do the same :)
Photoshop users:
Use the Image menu to change the mode to RGB.
Then use the Image menu to switch to 16 Bits/Channel.

Resources