Non-Retina resolution on newly created iOS App (Xamarin.Forms)? - ios

I just created a new app with a MvvmCross template. But the iOS resolution looks like non-retina. Also, I only have i386 and x86_x64 as supported architectures and not ARM like all my other projects have. So what do I need to change that the app runs on the native resolution?
Has some one an idea what I need to change that the app stops looking like it was made for a 4" iPhone instead of a new app? Here are a few screenshots that may help to make clear what I mean (the App "PLZ Suche" is the one with the 'old' looking resolution, compared in the App Switcher it is clearly visible - all screenshots are taken on a iPhone 6S).
Problem solved -

This 'compatibility-mode' is triggered when you do not include a retina resolution splash screen (or launch screen as it is called in the Apple ecosystem) in your app.
Make sure that you have all the right types of splashscreens included in your app.
You can either:
use a Storyboard (or XIB) that adapts to different screen resolutions automatically
use XCode Asset catalog 'LaunchImage' image set, and fill all the correct sizes
You can read more about all the sizes and the launch screen on the Apple documentation page.

Related

Launch Screen issues

When I first started to create my app, I thought that using launch screens would be a good idea, so I added the LaunchScreen.storyboard file and created a view controller meant to be the launch screen.
Now, however, I would like to remove this launch screen now. I have tried to delete the view controller and the file itself, which does not work, as the launch screen view controller still appears somehow. I have tried this answer, but nothing changed. I tried another answer(can't remember the link) which told me to delete a key-value pair in the project info. After doing that, the launch screen is gone, but a black screen replaces it, and the app is not full screen anymore on iPhone 8. There are black bars on the top and bottom of the screen.
My question is: how can I remove the launch screen completely without any side effects?
Xcode 9, Swift 4
Using a Launch Screen
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary.
Including static images will increase the size of your binary because you must include all resolutions (see below) otherwise you will see "black screen & the app is not full screen".
Starting April 2018, all new iOS apps submitted to the App Store must be built with the iOS 11 SDK. All new apps for iPhone, including universal apps, must support the Super Retina display of iPhone X.
https://developer.apple.com/ios/submit/
So, you would be best off replacing the launch screen with a really simple view of your application (with no data).
Take at the Human Interface Guidelines for more information: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/
To quote:
Design a launch screen that’s nearly identical to the first screen of your app.
Avoid including text on your launch screen.
Downplay launch
Don’t advertise.
You can do this by using the menu bar:
File >
New >
File
Once you have created your new LaunchScreen.storyboard you need to ensure it's the one assigned to the application. You can do this either through the project file explorer or through the application plist.
Using Static Images
If you are really committed to avoid using a storyboard then you can migrate to using launch images inside an asset catalog by pressing the button above the launch screen storyboard.
By migrating to launch screen images you will be required to provide all variants of screen sizes otherwise you will not support devices such as the iPhone X.
You might be required to delete the LaunchScreen.storyboard and delete the references in the project explorer / plist.
Final notes
You may be required to delete Derived Data to remove any cached version of the launch screen storyboard.

iPhone app does not work correctly on iPad after change from universal to iphone only

How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
I'm working on a game for iOS (iPhone) using Swift and SpriteKit. The game got rejected today for this reason:
Reasons for Rejection: 2.10: iPhone apps must also run on iPad without
modification, at iPhone resolution, and at 2X iPhone 3GS resolution
After searching on StackOverflow I found out that it might have something to do with my info.plist file because at first my app was 'universal' and later I've changed it to iPhone-only.
It seems like there's something wrong with the aspect ratio of all the nodes. Take a look at the screenshots below. At the left side is the iPad-simulator and on the right there's the iPhone-simulator.
Maybe the game still thinks it is running on iPad because the nodes appear in 4:3 ratio?
How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
Please help. Thanks!
I've also added a screenshot of my info.plist file.
Apple requires that each app targeted on iPhone should run on iPad in the specific manner.
This usually looks like the app on iPad is not full-screen, it's surrounded by black frame that resembles the situation that the iPad is simulating iPhone.
My suggestion is to use size class now to make the app run full-screen on iPad and this should fix your issue with Apple.
Simply choose in your storyboard Regular Width and Regular Height, delete the existing constraints and set new ones.
More help here and apple docs also might come in handy
Darvydas' comment solved my problem.
What size does your background node have? Also if you whant your app
run only on Landscape delete those 2 (Item 0, Item 1 PORTRAIT)

Launch screen is not being presented for iOS 9

I am having issues displaying an image as a launch screen. I have added some images that will walk you through what I have done.
My recommendation is to not use Launch Image and use the Launch Screen instead, since you can use auto layout and support any screen size, including iPad multitasking, or new devices released in the future.
However, if you really want to use the Launch Image, seems like iOS9 requires different launch images for each device orientation. That might be your issue.
iOS 9 enforces the UILaunchImages requirement; apps can no longer
declare the same launch image to support different interface
orientations.
https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0

#3x images incorrectly used on iPhone 6 or 5S or 5 in XIB's with the "Use as Launch Image" option set

With-in a clean brand new iOS project I've:
added 2 images to the project "background#2x.png" and "background#3x.png"
added a XIB named "LaunchScreen.xib"
checked the XIB's "Use as Launch Screen" option
added a UIView sub-view to LaunchScreen.xib and set its image name to "background.png"
with-in the project settings, under the targets 'General' settings I've set the 'Launch Screen file' to "LaunchScreen"
Now when I launch the app on any of the devices list below the #3x image is displayed in the resulting launch screen when surely the #2x image should be used.
Problem devices (that all use the #3x resource):
iPhone 5 (iOS 8.0.0)
iPhone 6 (iOS 8.0.0)
iPhone 6 (iOS 8.0.2)
iPhone 5 Simulator (iOS 8.0.0)
iPhone 6 Simulator (iOS 8.0.0)
NOTE that the #2x image is distinctive from the #3x image so I can easily identify which one is being used.
At first I assumed this was a bug with the simulator and was staggered when it occurred on a real device also.
I assume this is yet another iOS8 bug however I guess there's also the possibility that its expected behaviour as the result of the launch screen being cached as a static image of some kind.
Any ideas or potential solutions?
EDIT:
For the benefit of others, I have subsequently found that if the images are instead added to an Images.xcassets image set then the correct behaviour is in-fact observed. HOWEVER this is not an ideal solution for us since we have a very specific image export process which means we are not using an Images.xcassets in out project (there are thousands of images in the app).
I have now also raised a Radar with Apple #18513968
http://openradar.appspot.com/18513968
I've just tried this myself, and get the same behaviour you have mentioned.
By setting the Launch Images Source to "Use Asset Catalog", and adding the Launch Image you can get each device to show its specific background. Some screenshots can be seen here:
Supporting iPhone 6 and iPhone 6+ with different launch/splash screen image for iPad Portrait and Landscape orientations
Looking into it a bit more, I found a website that mention:
http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
"You can use the new adaptive UI features in Interface Builder to fit your layout to different screen sizes. If your scene requires screen-size-specific images, use asset catalogs to define different images per size class."
Maybe that is the only way to do it.

iPad Retina Images not showing?

In my application, I am having trouble showing iPad Retina images. I know I have to use the #2x~ipad.png extension in order to get them to properly show and I do that. My images are named according so they are all named the same besides the extension for each device. However, my images appear blurry when viewing them on an iPad 3. I know the images are the proper size and PPI but it just doesn't look clear.
My images are in my 'Copy Bundle Resources' too. I have tried to clean my project, and restart Xcode. No luck.
Also in Interace Builder in my iPad XIB, I have each image set to the -72.png image (I guess the image automatically switches to the #2x~ipad.png if it is an iPad 3 correct?)
Is there any way to confirm maybe via NSLogs to see if it is loading the correct images? Also is there anything else I should double check to ensure that the proper images are loaded.
Uh, if you really are doing this:
[name]-72.png and [name]#2x~ipad.png
thats not right.
If this is a universal app, then you have
Foo.png (or Foo~iphone.png) and Foo#2x.png (or Foo#2x~iphone.png) [NOTE: iphone not iPhone];
Foo~ipad.png and Foo#2x~ipad.png
This all working for me in my universal app.
EDIT: you can read about the naming convention in Apple's "Resource Programming Guide", page 46:
The bundle- and image-loading routines automatically look for image
files with the #2x string when the underlying device has a
high-resolution screen. If you combine the #2x string with other
modifiers, the #2x string should come before any device modifiers but
after all other modifiers, such as launch orientation or URL scheme
modifiers. For example:
MyImage.png - Default version of an image
resource.
MyImage#2x.png - High-resolution version of an image
resource for devices with Retina displays.
MyImage~iphone.png -
Version of an image for iPhone and iPod touch.
MyImage#2x~iphone.png -
High-resolution version of an image for iPhone and iPod touch devices
with Retina displays.
EDIT2: So I did trip on a reference to "-72" (and -50). These were used in iOS 3.1.3 and older. The full explanation is found "iOS Application Programming Guide", "App Icon" section (links too fragile to use).
What I am doing is setting the image names to:
[name]_ipad.png, [name]_ipad#2x.png. [iPad]
[name]_ipod.png, [name]_ipod#2x.png. [iPhone]
And, I added a category on UIImage, mc_imageNamed: that appends the _ipad or _ipod based on the current device. And of course I have set the images based on their names in the XIBs.
This method is guaranteed to work, from my experience. It would be great if someone would fix your issue, but this solution is also available.

Resources