iOS app not taking up entire screen in iOS 12 or 13 - ios

I have an old iOS app last built on iOS 8. When the app runs on iOS 10 or higher on larger phones the view doesn't take up the entire screen, there is a black bar on the top and bottom of the screen. In the past, Apple would just expand the app so it was stretched a little.
Not sure how to fix this? I am sure there has to be an expand setting or something? I believe it has to do with setting a Launch Screen, but not sure where to set that or how to? I do have a LaunchScreen.storyboard in my files.
I have tried multiple things to fix the issue, but nothing seems to work?
Also, not sure if it is related, but the Navigation Item (deprecated?) was once sticking to the top and now just randomly floats.

I have solved this problem on my older project by adding launch screen.
Try this if you are missing launch screen:
Add a new launch screen by going to File -> New -> File... -> Launch
Screen
Make sure the newly added LaunchScreen.storyboard is selected as
the launch screen file under project settings.
to check this follow this steps:
1)Choose your project name in Xcode. 2)Select your project target. 3)Then select app icons and launch images and choose your newly added LaunchScreen.storyboard.

Given the age of the app I suspect it uses fixed sizes or size classes for its layout?
You will need to update the code that controls the layout. If the design is simple and vertical based, you may be able to a 'quick and dirty" solution by embedding everything in a stack view. However you should really update your code and/or storyboard to use Autolayout. This will fix the current problem and ensure it will work with future devices of different sizes.

Related

iOS app missing splash screen, new black borders and ui glitching after visualstudio 8.10.10 and xcode 13 update

Just updated to Xcode 13 and Visualstudio Mac to 8.10.10. Since then my app:
Wont display the splash screen.
The app is cropped at top and bottom.
Ui is acting generally weird.
Now I have read old threads on similar problems and adding the Launch screen interface file base name. in the info.plist file does make the app cover the whole screen.
I have tried switching splash screens and change location. But it's just black. I don't use a storyboard for the splash and instead provide several different resolutions, which have worked fine for several years.
The UI is glitching like the loader picture, and several different ui elements where colors are provided are "cut" in the middle showing two colors when it should switch.
I have read the release notes for xcode13 but haven't found anything related that would break the whole UI.
The interface glitching and no splash screen I can't seem to find a solution for. Everything worked fine before the update.
What could be the problem? Some setting in the info.plist, a checkbox in the storyboard?
I'm still new to Xamarin and iOS development and greatly accept suggestions.
Let me know if I can clarify anything.
Thanks
iOS load glitch picture
According to your statement, you are not using a storyboard, so you need to replace the Launch Screen with a LaunchImage, then check the LaunchImage file (if it does not exist, you need to create it yourself) and add all strictly standardized pictures inside.

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 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.

iOS simulator screen size

It is just 2days to start iOS programming.
So I'm very beginner in this area.
<--This image is in iOS simulator. As you see right part is cropped.
<--This image is original UI.
I don't know why some parts have gone.
I am using MacBook Pro 2011 with Yosemite OS and brand-new XCode.
I tried cmd+1, cmd+2, cmd+3.
Please help me.
Thank you in advance.
Go to file inspector and uncheck the "use size classes" option, this is due to newly introduced size class feature to support all devices in ios 8
The new user interface works with all sizes of devices at once. The default size is 600x600 as you are seeing. When you simulate, is uses autolayout and constraints to arrange objects for the desired screen, aka an iPhone.
If you want to place the label in the center of the screen, Ctrl+drag from the label to the background, release mouse and buttons and the constraints options will appear. Click Center Horizontally in Container and Center Vertically in Container.
Run again. It will be centered.
Best regards
Select your view controller and find size inspector, Change fixed to freeform and give whatever size you want
I had a closely related question, and Mehul Thakkar's answer helped me to get where I needed to be, but I'm adding a new answer to flesh out both the question and answer a bit.
I was working on an iPhone app for iOS 8 that was shrinking the interface on larger screens to the size of the iPhone 4s. I don't use storyboards or Interface Builder nib/xib files at all, and do everything programmatically; for iOS 7 and earlier, I didn't bother making an explicit launch screen as my UI was simple enough that it loaded very quickly and a launch screen wasn't necessary.
Anyway, after finding this page and poking around a bit, it appears that creating a launch screen storyboard or nib/xib is now necessary on iOS 8, if you want your application to run at the correct size? (At least, I couldn't find any other way to coerce Xcode to do it in the project settings or whatnot.)
To do this, I created a new launch screen .xib file, unchecked "Use Size Classes" in the "Interface Builder Document" section of the File Inspector of that .xib file, and set the "Launch Screen File" under the General tab of my target settings to use that .xib. After that, the app ran at full screen size again.
This works for me and I guess I don't mind putting in a few minutes to turn the .xib file into a proper splash screen, but I'd be interested in hearing if there are other/better ways of making things work in iOS 8 and beyond, for those of us who hate our lovely code being tainted by the presence of those nasty storyboards/nibs/xibs...

Resources