iPhone 6 - app does not fill screen - ios

Most of my apps scale up when run on an iPhone 6, but for some reason one of my apps looks like this:
What would cause it to not just scale up and fill the screen?
EDIT: Here are some repro steps:
Create a new project (Single View). Turn off size classes and just use iPhone.
Make the background orange.
Add a yellow UIView subview at (20,20,280,200).
In Xcode you get this:
Now simulate on iPhone 6. You get this:
Why doesn't it just scale up and look normal?

Not sure why this is getting downvoted. It's a legitimate question. And here's the legitimate answer:
Remove the "Launch Screen File" in Projects > General. Xcode 5 did not have this so older apps scale up automatically. Apps created with Xcode 6 get a default Launch Screen file created.
Removing it will make your app scale up on iPhone 6.

I have got the same problem and I managed to solve it by adding constraints to my ViewController in the storyboard.
Make sure that you clicked the ViewController of your scene. They yellow button in the this screenshot.
Click Editor-> Resolve Auto Layout issues -> Add Missing Constraints
Now you will find that the background image is scaled up to fill iPhone 6 or iPhone 6 plus.
Note that this solution works for me even if I did not provide any launch screen file.

I had the same issue. Searching for an answer, most of them mention the launch image. To me, what did the trick, was that I first enabled launch image for iOS8.0 and later in Xcode, which requires the native resolution sizes for 4.7" and 5.5". Adding these sizes didn't help, but when I re-disabled them, it started working!

If you do have any launch image, you will need launch images for all appropriate sizes. I was doing a minor update to an app, and it was not showing correctly on the iPhone 6 simulator. I created four launch images (.png files). Since the app should still run on iOS 7, I apparently could not use an asset catalog. I gave the images the correct names, and all is good.
Image sizes and names may be found here:
Sizes and Naming of Launch Image for iPhone app in iOS8

Related

iOS 13 Project without Storyboard displays funny

I have this project that is not using storyboards when I run it on my iPhone simulator it is not coming up full screen ?
From the viewcontroller property inspector select the presentation and set it to full screen it will work check the below image
check the content mode it should be scale to fill and size as freeform
Add below image to your project. Using the name Default-568h#2x.png
Because Xcode doesn't know your app size so this will pickup smallest size 320x480. With this image and name I suggest above, Xcode will recognize your app support bigger size.
Don't worry when running your app in smaller device, it's still OK.
Image HERE
This might be related to issue in launch screen. I also setup the project without storyboard but deleted the LaunchScreen.Storyboard as well and ended up getting the same screen as yours. After I recreated the project but leave the launchScreen file i was able to get the full screen display for my viewcontroller

iOS 9 xCode 7 built app displays black rectangle instead of splash screen

I know this question may seem like a duplicate of a few existing ones but its not.
I am struggling with this issue where universal (iPad/iPhone) application does not display the splash screen anymore.
Before upgrading to iOS 9 and Xcode 7, no such issues were present. After upgrading no changes were made to the splash screen in any way.
Tech data relevant to the question:
Supported devices are iPad (landscape only) and iPhone
(portrait/landscape)
I use "Launch Screen.xib" that has an UIImageView with size classes and
constraints set up so that it's always full screen.
I have added all splash screen images in image assets (except iPad
Portrait ones)
I use Xcode Version 7.0.1 (7A1001) and iOS 9.0.2
This issue does not happen on an iPad
The wrong splash screen looks like this on iPhone 5s:
This is made in portrait mode, so there are white squares on top and on bottom of this "black square".
I was struggling with this issue yesterday but I managed to fix it by renaming my launch screen to "LaunchScreen.xib" (without the space). But this morning the issue re-appeared.
Things I've tried:
Removing and creating LaunchScreen.xib again with and without space
Creating LaunchScreen.storyboard file instead of xib
Adding #2x and #3x versions of image used in LaunchScreen.xib
Removing/adding/replacing images in image assets
Cleaning, build cleaning and even deleted derived data
Restarting device, reinstalling app, relaunching without building and many other solutions that I could think of.
Nothing helped, so maybe someone fixed a similar issue already and can lead me to the right direction.
EDIT 1
So I renamed my LaunchScreen.xib image used from "Default.png" to "DefaultSplash.png". This instantly fixed all issues on iPhone. But now I have a new problem - iPad splashscreen is now black. If I set the LaunchScreen image to some other image used in project, the Ipad displays it as splashscreen without any problems, but neither Default.png nor DefaultSplash.png can be used on ipad now. This is really weird issue.
In my case the images in the "Launch Screen.xib" weren't displaying. I had to rename them and reset the new names in the nib file to make it work.
So I fixed the issue like this:
Since I renamed the file LaunchScreen.xib, it fixed an issue on iPhone but caused a similar problem on iPad. Since then, I cannot use the same image file name for the same xib (i.e. if image "Default.png" failed, it cannot be used anyomre... Bug?). So I created two files, LaunchScreen.xib and LaunchScreen~iphone.xib with separate image files for each. Now it works okay.
Seems ugly and buggy but it works.
There is a change in Xcode7 iOS 9 onwards. They have modified Launchscreen(Black screen we will get).If you change deployment target means you can see the previous launch screen. Only empty view controller is present so we have make changes on it.
As per requirement in assets add images in imagecassets.
It may sound stupid but something related to this scenario may happen:
If you hook any outlet and then break it by changing the custom class you will get this black screen behavior without any warning, instead of the typical crash from any non launch storyboard/scenes this will lead to a black screen before the app start.

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

iOS 8 UITableViewController separator scrolling render

I've come accros a problem with iOS 8 on the iPhone6 and simulator, when you have a UITableViewController with visible separators there seems to be some render problem. Now I could post some code but really if you make just a simple UITableViewController you would have the same problem, just look at eBay and Kijiji they all have this issue.
Normally you wouldn't see this small difference if it only happened once in a blue moon but if you scroll none stop you will see it flash. (less on Ebay since their separators are too close to white but Kijiji is pretty apparent)
Sorry I wanted to post a screenshot but sadly I don't yet have the reputation to do so therefore you will have to try it out yourself's.
Any help would be appreciated
Thanks
The reason why the separators flash is because the app is not designed for the larger displays, and the phone is upscaling the app to fill the larger screen. Since the separator height becomes fractional, the separator line crosses pixel boundaries and becomes antialiased, making it appear wider, lighter, and/or darker than normal.
The answer is to (wait for the developer to) update the app to support the native resolutions of the iPhone 6 and 6 Plus.
You can enable native resolution in your own app by adding launch images or a launch screen file.
Launch images
iPhone 6 requires a portrait launch image of 750x1334.
iPhone 6 Plus requires both portrait (1242 x 2208) and landscape (2208 x 1242) launch images, since it can launch apps in landscape as well as portrait.
Launch screen file (iOS 8)
You can add a launch screen storyboard or nib through Xcode.
In Xcode 6, open the File menu and choose New > File... > iOS > User Interface > Launch Screen.
In the General tab for your project's settings, look for the App Icons and Launch Images section. Set the Launch Screen File to the name of the file you created. This will set the UILaunchStoryboardName key in your Info plist.
Add Renders with edge antialiasing in your plist file, fixed the problem for me.
Remove the Clips Subviews on my custom cell did fix the issue for me.

auto layout in Xcode 5 ios 7. How to create app that works in both iphone 4 and iphone 5

I own an iphone 4 device and do not have immediate access to iphone 5. I am using the simulator to test things out. I have already tested my app on iphone 4 and its simulator and it looks fine. When I run the app on iphone 5 screens (4-inch screen simulator), the app does not seem to work and I get two black empty spaces on top and bottom (see below):
I suspect there is more to making an app for both iphone 4 and iphone 5 than switching autolayout on (which is the case for me.) I am going to read up on autolayout more now but thought I would throw this in here to confirm if I am not missing something obvious.
Thanks!
UPDATE:
To solve this issue, you need to generate a launch image of size 640X1136. The question is how do you do that since in the simulator you would need this image for it to work properly? The solution is to generate ANY picture of dimension and make it the Default#2x image. LAunch simulator - the app would look normal now. Now you can go ahead and generate a "REAL" launch image of this size and replace the dummy one!
To solve this issue, you need to generate a launch image of size 640X1136. The question is how do you do that since in the simulator you would need this image for it to work properly? It is a chicken and egg problem. The solution is to generate ANY picture of dimension and make it the Default#2x image. LAunch simulator - the app would look normal now. Now you can go ahead and generate a "REAL" launch image of this size and replace the dummy one!

Resources