JDibble
JDibble

Reputation: 744

iOS Application Doesn't Fill iPhone Screen

I am writing an iPhone app using Xamarin. My UIViewController does not fill the entire screen, there is a gap above and below. Here is a screen shot from the simulator. I have changed the colour scheme to make the gaps more obvious

enter image description here

The screen design was done in Xcode below is a screen shot of the settings for the UIViewController in Xcode.

XCode settings

What am I doing wrong, why is the View too small?

Upvotes: 14

Views: 7987

Answers (2)

Chris
Chris

Reputation: 2446

I was having this issue when running my app on an iPhone 7. There was a black bar along the bottom.

I tried following the other answers but the iOS Launch Image is marked as Depricated in Xcode 12.5.1

What solved it for was to add the UILaunchScreen key and empty <dict/> to my Info.plist file like this:

...
<plist·version="1.0"> 
<dict> 
...
    <key>UILaunchScreen</key>
    <dict/>
...
</dict> 
</plist>

If your using xcode to generate your project files this is probably not an issue, but my .xcodeproj and Info.plist are generated by the xcodegen tool which did not add this key-value to my plist.

If your project does not have a info.plist file, you need to go to targets->info and click on + icon to add the key and value (dictionary)

enter image description here

Upvotes: 4

Liam
Liam

Reputation: 12668

Put a 4" launch screen image into your asset catalog or info.plist

Upvotes: 28

Related Questions