I wrote an iPad app and I'm using two different images as launch images.
The iOS simulator shows the proper image during startup but the device always uses the portrait image. I have the right file size (Xcode does NOT give me any warnings)!
I'm using iOS5 Beta 7 with Xcode 4.2
Here is what I did so far:
I double checked all the file sizes
I readded the files to the project,
I build the project from scratch (including 'Clean')
I cleaned the workspace's derived data directory.
I deleted the app completely from the device.
I restarted the device.
I'm running out of ideas.
Any ideas?
In iOS 3.2 and later, an iPad application can provide both landscape and portrait versions of its launch images. Each orientation-specific launch image must include a special modifier string in its filename. The format for orientation-specific launch image filenames is as follows:
basename_usage_specific_modifiers_scale_modifier_device_modifier.png
Application Launch Images.
I solved it. I couldnt find any mistakes. So I removed everything according the launchimage from the project (including entries in info.plist), deleted the derived workspace folder, deleted the app from the device. Inserted the pictures again an set the basename for the image in info.plist. It worked. still don't know why.
Btw: It seems like Xcode 4.2 (and iOS5) changes the sizes of the launch images for the iPad.
iOS < 5: Portrait 768x1004px Landscape: 1024x748px (Source)
iOS = 5: Portrait 768x1024px Landscape: 1024x768px (Source: Image)
I did this:
Rename image to Default-Landscape~ipad.png
In Info.plist register it as
Blockquote
<key>UILaunchImageFile~ipad</key>
<string>${PRODUCT_NAME}/Default.png</string>
Blockquote
and it seems to work...
Related
I have an universal app. The splash screen loads fine for iPhone but the same is not visible on the iPad. Instead a black screen appears in its place. I have gone through the questions posted in this regard and have followed the steps but to no avail. I am using asset catalog in my project. Storyboards have not been used. The names and dimensions of the images used are as follows:
1. Default-Landscape.png (1024x768)
2. Default-Landscape#2x.png (2048x1536)
3. Default-Portrait.png (768x1024)
4. Default-Portrait#2x.png (1536x2048)
5. Default-568h.png (640x1136)
6. Default.png (320x480)
7. Default#2x.png (640x960)
Please let me know if there is anything wrong with the dimensions I am using. The options I have selected for the Attributes Inspector for the Launch image are given in the image below:
Following is the setting for Launch image:
I added the same launch images to a sample app and the launch screen showed up perfectly on iPad.
EDIT:
As per the suggestion of #iphonemaclover, the problem was solved using "You should also remove any other key suffixed with (iPad) or ~ipad." There was a key UILaunchImages~ipad in the plist which I removed. Now the launch screen is properly visible.
Please delete your derived data and clean the your project.
Also reset your simmulater if you running over it.
Hope it will help.
Also check you have selected Universal App in your target setting.
EDIT
You should probably be using an Asset Catalogue for your launch images, which might be what Xcode is expecting. You can see what Xcode is expecting in the General tab for your target:
MORE Suggestion
Q: Why does my app launch to a black screen on iPad?
A: Apps that have been designed only for iPhone may launch to a blank screen when run on an iPad. This is caused by the presence of an empty iPad specific storyboard in the app bundle as well as an iPad specific UIMainStoryboardFile key in the app's Information Property List (Info.plist) file. Both are automatically created by the various Xcode template projects if the Universal option is selected.
...
In Xcode
Look for a file named MainStoryboard_iPad.storyboard in the file navigator. If this file is present, remove it from your project.
In In your app's Information Property List
Look for a key named Main storyboard file base name (iPad) or UIMainStoryboardFile~ipad. If this key is present, remove it. You should also remove any other key suffixed with (iPad) or ~ipad.
Finally, test your app on an iPad or in the iPad simulator and verify that it behaves as expected.
You should add your launch image to your asset catalogue, and make sure the setting shown is configured correctly.
If you don't have one already, you can add an asset catalogue by going to File > New > File, the look under the Resource tab.
Probably not related to most people's problems but I would like to add another possible issue. I had the same problem with my project. I could see my iPad images in X-Code but what I missed was that the title underneath was "unassigned" and not "iPad Portrait" (this was probably because it was a boilerplate React Native project that was initially configured only for iPhone).
After making my app universal, I needed to recreate my LaunchImage set which then had designated placeholders for iPad. I re-added all my images, assigned the new Launch Image set, clean, build and it was fixed. Hopefully it saves someone else some time.
If you're not loading an image in your slash screen do you get the white view? If you're not getting, then your view is not loaded. That is why you're getting a black screen.
I'm trying to run my application on an iPod 5 (4inch retina screen) but it shows the 3,5 inch version of the application.
On an iPhone 5S it does show the correct screen size. Are there any known settings to accomplish a setup like this and how can I turn it off again?
You need to make sure that you have all the images set in the LaunchImages.
You can find this in the images.xcassets of your project in xcode.
Apparently you also have to assign the Image asset to the project. In your target you see the asset to choose from in the 'app icon and launch images' section, here it pointed to an old & renamed asset.
Changed it to the correct one, removed the derived data and it worked.
The only consolation I take from this is that apparently I am not the only one having difficulty, specifically generating a launch image. I have googled the issue hundreds of times, consulted the iOS Dev Centre and searched through my rather extensive library of texts on the matter.
How are launch images created in Xcode 6 on an iPhone 5s(iPhone4 s) running iOS 7?
set Launch Images in project setting pageļ¼>general->launch image source
I had this issue because I'm using Xcode 6.1 and my app deployment target is 7.0.
I tried using the asset catalog with my existing images. Doing that gave me this error:
/ObfuscatedProjectPath/Images.xcassets: The launch image set named "LaunchImage" did not have any applicable content.
My solution was to turn off the asset catalog and use the default names for the images:
Default#2x.png (iPhone 4/s size is still supported in iOS7)
Default-568h#2x.png (works for iPhone 5/6/6Plus sizes)
I updated my application to use Image Asset for App Icon and Launch Images i set both with
appropriate image size according to Apple Doc. The issue that I have that for Iphone
and the simulator for (4S/5/5S) the launch image/screen is always black except for
Iphone 6+ but it works fine on iPad. I looked at couple of post here and nothing have
worked as follow
1) deleting the asset catalog and creating a new one
2) adding #2x and 3#x to each file before adding to the catalog
3) removing and redeploying the application
Anyone had that issue when porting image catalog ? Im using Xcode 6
Targeting ios 7 and 8
Thanks
Mike
Update 1
When disabling landscape launch screen appears normally
something i noticed before doing, so on either the device and the simulator
the application starts in landscape even if the device is held in portrait
and then it rotate to portrait. Still trying to solve that issue now
The following steps are worked for me:
Add the images to the project (root directory or Resources folder) with the following nomination (I will describe them into the Portrait launchimages): Degault.png (3.5 inch), Default-567h#2x (4 inch), Default-667h#2x (iPhone 6), Default-736#2x (iPhone 6plus).
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to not use asset catalog ('Do not use asset catalogs').
Remove the LaunchImage asset from your main image asset
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to use asset catalog
The XCode 6 is going to ask you about image asset migration from the existing images. Just click to 'Migrate'.
And it worked for me for each kind of devices on iOS7, iOS8.
Note:
If you check the new LaunchImage asset, than you can see it is really strange. It seems to contain only a few image without the images with iPhone6 or iPhone 6plus resolution.
I found that if I go to the app target general tab and remove all device orientations, the launch image will show again (i.e. the black screen goes away). After running the app, I then went back to the app target general tab and restored the desired device orientation and the launch images continue to work as desired.
(My answer should be in the comment section but I can't post it there due to my reputation)
May be these are very basic steps but:
Have you tried doing a full clean and deleting the derived data?
Have you checked the General tab of your target, under App Icons and Launch Images?
I am trying to set default launch images from general setting section for my project using xcode 5.
Issue is when I am trying to set launch images for ios 6.1 and prior retina of iPhone and iPad, xcode is forcing me to rename the file name from Default~ipad#2x.png to Default.png and Default~iphone#2x.png to Default.png for iphone. But if both the files having same name get loaded then it is not showing proper launch images as per device type.
Can anyone guide me for the same? I have attached screenshot of error for more information.
Try this. Set the names to Default#2x~ipad.png and Default#2x~iphone.png