iOS 13 Project without Storyboard displays funny - ios

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

Related

App does not fit on anything but an iPhone (Plus Models) [duplicate]

Running my App in the iPhone X Simulator (GM Seed) I am noticing two strange effects:
the App does not use the full screen space (top and bottom area is black)
a strange white bar beneath the title bar
Does anybody know what is happening here and how to resolve this? I can't find any new settings in Interface Builder.
When using launch images (instead of the much easier Launch screen file), you need to provide the properly sized launch image for each device size you wish to support. Once you add the additional launch image, your app should take advantage of the new screen size.
The new iPhone X requires a launch image sized at 1125px × 2436px which is a 3x image for 375pt × 812pt.
Of course if you switch over to using a Launch screen file instead of individual launch images, your app will automatically adapt to all device sizes without any additional work.
I have figured out this issues in iPhone X. Launch image size (1125*2436px)
Please flow this below steps.
1.i)Choose your project name in Xcode.
ii)Select your project target
iii)Then select Launch images source
You can get Migrate popup
i) Choose Assets
ii)Select Migrate
After that select your Assets.xcassets in your project
Then select Launch image in assets
i)Then select attribute inspector
finally check your Launch image source. you can see set Launch image.
iPhone X needs different launch image sized 1125px x 2436px (375pt x 812pt #3x).
Check human interface guidelines for more details.
I have figured out how to fix (though I still don't understand why this happened only on iPhone X) LaunchScreen storyboard on iPhone X with seeing black top&bottom bars.
I have LaunchScreen storyboard with one UIImageView.
UIImageView's top&bottom has to be pinned to SuperView's top&bottom. NOT to SafeArea.
I fixed it by simply inserting some random text in the Lanch Screen File textfield. I dont even have a Launch Screen File... XCode is so buggy.
update
Although this fixes it in simulator (still very weird and unexpected) when uploading a binary to iTunes Connect it will fail due to not finding a LanchScreen file of name "random-name"
Just ran into this while trying to update an app I hadn't worked on in a while.
On Xcode 9.4, I was able to fix this by doing the following:
Add a launch screen by going to File -> New -> File... -> Launch Screen
Make sure the newly added launch screen storyboard is selected as the launch screen file under project settings.
If you already have a 1125px × 2436px launch image but the app is still not using the full screen check to make sure that your image is PNG.
if you removed LaunchScreen.storyboard; Choose your project, select your project target, General -> App Icons and Launch Images -> Launch Screen File: Select here Main.storyboard instead of LaunchScreen.storyboard
Just had this problem... When I selected the project & the correct target I had a blank for the 'launch screen file' under the app icons and launch screen images tab. I set it to the default LaunchScreen and the resizing issue I faced was taken care of.
You may check in project target launch screen file is not set to empty if it is empty it may cause problem.
Yes me too face that top spacing issue in iOS 15,
iOS 15 needs some new size of the Launch images
So you please check your all the launch screen images
Check your Attribute inspector is portrait for Launchscreen

Images in LaunchScreen.storyboard Disappear in Device

I put an image (my logo) in the launch screen storyboard file. The project was built using storyboard from the beginning. But I notice that the image does not appear when I test the app in my device. It appears ok in Storyboard though.
Any idea how to solve this issue?
Firstly clear deriveddata then delete your app from device. Then shutdown your device and restart it.It woks for me.Also you have follow UI guidelines of apple.
The Image needs to be of exact size, replace your image with correct size and it will work.
You can check the size at: https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
Just drag and drop the images from Assets.xcassets to project folder and set LaunchScreen.storyboard as imageName.png
Clear the derived data, clean the project,delete application from device.
Install application in device.
Let me know if you have any query.
Thanks
I had the same problem, and for some reason it worked better to create a launch screen image with the proportions of an iPhone6 screen in Photoshop (or any other image manipulation program at your choice), and place it on the launch screen inside an UIImageView (and let it stick to it's superviews edges).

iOS Xcode LaunchScreen Storyboard not displaying

I'm trying to use Xcode's LaunchScreen storyboard as my launch screen? All the questions that have previously been asked about this refer back to the old launch image or .xib method - trying to do it now with the new LaunchScreen storyboard that Xcode automatically generates instead. I've selected the LaunchScreen storyboard as my launch screen file in my Deployment Info:
The storyboard itself confirms that it is set as the launch screen in it's file inspector.
And the info.plist file reflects this as well.
And yet, it doesn't work. The LaunchScreen storyboard never shows - it just goes straight to the first screen in my main storyboard. Using Xcode 7.2 and deploying to iOS 9.
Enable these two settings for the LaunchScreen.storyboard
If you are using xcode 11.2 you'll need to remove the app and execute it again to see the launch screen. I have to do this every time I modify the launch screen in order to see the new changes.
Another thing to make sure is that Launch Screen File is set to Launch Screen.storyboard
**Delete the app from the device. Re-run. **
In my case I had all the suggested settings set correctly but continued to have the original blank launchscreen. In the spirit of AmJa's suggestion regarding a "cache" problem, I deleted my app from my device and reinstalled. Reinstalling did the trick for me on both my devices and simulators.
In case anyone else runs into this issue, I resolved it by simply deleting the ViewController on my LaunchScreen storyboard (leaving me with an empty storyboard), creating a new ViewController and resetting the Storyboard entry point to that new ViewController. There may be some sort of bug with XCode 7.2 with respect to the LaunchScreen storyboard and default entry point into the auto-created View Controller, but then again, I've tried replicating this 3 times and it hasn't ever repeated itself, so maybe not.
In storyboard, in ViewController scene, I had to check Is Initial View Controller for storyboard to be seen as Launch Storyboard.
Suprisingly this is not checked when you add first View Controller. Xcode 11.
Just in case it helps someone.
Scenario, I created my new project and copied a old Launch Image from another project. And then started getting the launch image but when I wanted to change it to new image then still i was viewing the old image it was stuck for ever as launch image no matter what I do.
Then I reset my Simulator and restarted my iPhone and there you go I stared getting the new image. This looks like that somewhere in the documents or cache the devices store the old image until you reset the phone.
Thanks
As #abanet, mentioned in his answer, anyone who uses Xcode 11.2 and above, they have to delete their app and launch it again to see launch screen changes. It's not reflecting immediately. It looks like a bug from Xcode definitely not an intension.
How to fix for Xcode 11.0 and above:
Do this: https://stackoverflow.com/a/41287094/2190175 if you haven't already, and after that:
Delete app from device / simulator
Restart device / simulator
Reason: Launch Screen part of storyboard is cached during development and doesn't change until you remove app from device / simulator and reinstall it completely.
Other solutions didn't work for me, but this did:
Toggle on and off Device Orientation (e.g. support Upside Down) and Hide Status Bar in General.
I'm not sure which one did the trick, but it's working now.
If you don't see anything and your Launchscreen.storyboard only has an ImageView in it, then it might actually be showing the storyboard but not the image. Try putting a button in it or something. I've discovered that my Launchscreen.storyboard is actually showing but won't show any images and I don't know why.
The issue can be also that the "LaunchScreen.storyboard" is not added to this target.
To fix this open "LaunchScreen.storyboard" then press on "File Inspector" and under "Target Membership" add it to the needed target.
I tried everything mentioned here, the only thing that worked for me was creating a new LaunchScreen file. I'm using Xcode 12.1
(Don't forget to update the reference in the targets settings)
I was banging my head against a wall with this since Xcode 10.1 does not include a launch option for the new 11" iPad Pro when you create a new iOS Launch Image set, and without it, the iPad Pro doesn't display correctly, leaving me no choice but to get this working with a Launch Screen storyboard.
I tried combinations of so many things, but I wanted to post what ended up making it work 100% of the time (which was, in fact, a combination of a number of things).
As you have no doubt read, for the UIImageView within the Launch Screen storyboard, you should NOT include the extension (.jpg or .png). So many posts say that, but leave out that the reason is that you should create a new image set within Images.xcassets (NOT Launch Screen image set, but just image set) and name it whatever you want (for instance, "Launch-Default"). Then, drag and drop the desired .jpg or .png into the new image set. You will then use the name of that image set within the UIImageView in the storyboard and everything should work fine (the image should even show up inside of Interface Builder).
Also, within the General settings for the project, make sure to set the Launch Screen File to your new storyboard.
You need to add App orientation specific Launch Screen.
LaunchScreen Portrait: https://app.box.com/s/hfoeuvsy68iu913keb8p5hs1z9fdz3jk
LaunchScreen Landscape : https://app.box.com/s/o9q5nkrvk2ewdh57oiiar85zf658olgj
Drag LaunchScreen.storyboard & LaunchScreenBackground.png to Xcode sidebar. Then specify LaunchScreen in Xcode General page. See attach image
In my case, the problem was that the image for the logo was taken from a different target. Make sure that the image is from the main target of the application, and reset the simulator via menu Device/Erase All Content ad Settings...
In my case a few image views cover the whole parent view of the launch screen (e.g. pinned to the view edges). I had to uncheck the Resize view from NIB in the Attribute inspector for the launch storyboard and finally it worked for me (just do not forget to manually delete the old app from the simulator)
In my case the background color of the view (full screen) was set to a "missing" color literal! After trying all above of course ;(
A jpg image does a problem change the extension to png or use another png image
Worked like a charm for me
in xcode9 swift4 LaunchScreen storyboard, use .jpg image & uncheck clear graphics context for imageview. it's absolutly working.

Launch Screen not displaying iOS 8

I'm trying to get the Launch screen to display instead I get the default black screen.
I remember I've had this issue in the past and is something really silly but I can't remember what it is.
I have a LaunchScreen.xib. I've set in my target -> info to use LaunchScreen and not image catalog. I am running iOS 8 and using Xcode 6.1. I tried on all iPhone simulators and iPhone 4s.
I can't think what more info to give than that.
For those who are still looking for another answer here's what worked for us:
Our launch xib only contains an imageView in the middle of the view. For some reason the image never showed (but the view was there, checked it with changing the background color).
The solution was to move the image file out of the image catalog and just drop it in the project as a standalone file. Pretty strange considering when we tried other images from the catalog they appeared correctly but not this one. Anyway, I hope this helps someone!
I had the same issue.
Turned out that I had earlier tried to attach a viewcontroller file with the launchscreen. To fix:
Go to launch screen
Click Connections Inspector in right pane
Remove all connections.
Accoring to #doctorBroctor: also go to the File's Owner tab and remove the connections there.
Go to your launch screen
Go to file inspector
Check the checkbox for "Use as Launch Screen"
I have tried with:
Deleted Launch Screen File.
Tapped on Use Asset Catalog in Launch Image Source and added Splash screen Images as desired in the image asset.
Deleted Previous Project on Simulator or Device. Clear the Project.
Run Again and it is showing now.
One reason for why you might experience the black screen instead of your launch screen is that the .xib file might not get copied in your build phase. At least that was my issue that caused my app to show the black screen even though I had done the steps you describe.
So, double check that your LaunchScreen.xib (or whatever it is named) appears in:
Your target -> Build Phases -> Copy Bundle Resources
And if not, make sure to add it. That resolved my issue.
For me the problem was that I hadn't selected the LaunchScreen.storyboard in the General tab of the project settings.
I've experienced the same issue. The solution for me was simply delete the app, reboot the device, then reinstall it. I think iOS caches the Launchscreen, and this cache is not invalidated every time when it should be.
I had the same issue in iOS 9 as well. Deleting the old app in simulator alone is not enough. Simulator has to be quit launched. It worked for me.
I fix it by select the "is Initial View Controller" in storyboard.
Make sure to delete the installed app from the emulator. Then run the app again from xcode (product->clean, product->run).
That worked for me.
I've looked at all the above answers, it helped a bit. Especially the answer by Suragch put me in right direction.
The LaunchScreen.storyboard isn't showing up, even after applying simple background colour to the view and removing the image.
Firstly, I cannot see the "LaunchScreen.storyboard" as shown in the image
This was because, some reason the LaunchScreen.storyboard wasn't added to the build Target.
Solution: Ensure the LaunchScreen.storyboard is included to the build Target.
Also, Choose the LaunchScreen.storyboard from the drop down as shown in above pic.
I hope it helps someone!
I found this old post 'cause my launch screen WAS working, then it stopped. I thrashed around for a good while and then realized this, undocumented problem:
If your launch XIB or storyboard file has a UIImageView with an image whose name contains a space, the entire screen won't load.
I only had a centered UIImageView in my LaunchScreen.xib that contained an image (.png file), and had the same black screen showing.
I removed the image (the .png file) from the project, added it again with new name, and used the new image.
Make sure to use empty Launch Screen File, then Xcode would use Launch Image Source.
Make sure you have "is initial View Controller" checked in interface builder.
I tried pretty much everything else but this finally fixed the problem and now it works in simulator as well as the device.
New feature in the iOS 8 SDK: you can now use a storyboard scene in place of your app’s launch images.
Create a blank storyboard file named LaunchScreen.storyboard.
Go to your target settings and, on the General tab, select the storyboard as your Launch Screen File. Xcode will add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.
Add a view controller scene to the storyboard. Add some subviews to the scene and position them with constraints. When you launch the app on a device, the OS should use the scene as the launch screen.
For more information check out this blog post by Ole Begemann "Replacing Launch Images With Storyboards".
Reset Simulator working for me
For iOS 14 and newer:
Device > Erase All Contents and Settings...
For iOS 11 and newer:
Hardware > Erase All Contents and Settings...
For previous versions:
Simulator > Reset Content and Settings...
Your launch image should be a PNG. A JPEG may work under certain targets, but you should use PNG anyway.

iPhone 6 - app does not fill screen

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

Resources