Screens of an iPhone App have a fixed aspect ratio - ios

I am adapting an iPad app (originally built on Objective C/Swift) for the iPhone.
I have removed all things from the UI, the only things left are:
Blue fill - the navigation bar
Red fill - the toolbar
The app appears to have the screen's aspect ratio somehow hard coded for the iPad. I am unable to make the app occupy the full screen using both the interface builder and directly editing the code of the UIViewController.
Doesn't work on iPhone X 11.4 and iPhone 5 9.3, works only on the iPad family.
The issue seems to be outside of the UIViewController or even the UINavigationController.
What project setting may be causing this issue?
iPhone is allowed in Xcode, Targeted Device Family is resolved as 1, 2 for the whole project
Requires full screen is checked for iPhone
The app on various iPhones:
Interface builder - all seems fine there:

Please check for launch images. You need to provide the all sizes of the launch image which are not provided.
You can also add missing sizes from the utilities bar.

Related

Device Layout Does Not match Simulator or Storyboard

I've been away from Xcode for a while, so I may have missed changes in the latest couple of releases. The layout of views looks identical in the Storyboard, and on the simulators (iPhone6 and iPhone7), but different on my iPhone 6. I have no warnings or errors in the Storyboard, and I am using Xcode 8. The device acts as if it had a shorter screen than the simulator -- things that are spread appropriately on the storyboard or simulator, are squeezed together vertically on my phone. What is the reason for this difference?
Have you assigned launch images with the correct dimensions for the different form factors? An easy way to verify this is to add a print statement in a view controller to see what the bounds are for the screen. Verify that these values match what you expect for the device.
The following from Apple documents this:
Because device screen sizes vary, launch screen sizes vary too. To
accommodate this, you can provide a launch screen as an Xcode
storyboard or as a set of static images for the devices your app
supports. Using an Xcode storyboard is the recommended approach, as
storyboards are flexible and adaptable.
While not an official Apple site, this link also references this as a potential issue:
The launch XIB or storyboard is required to support iPhone 6 sized
apps.
Another possibility is that you have the screen zoomed in on the device. To change this, go to Settings > Display & Brightness and select Display Zoom at the bottom. Ensure that you have Standard selected. If you are zoomed in, then the device will scale down (A 6 behaves like an SE, a Plus behaves like a 6/7).

How To Fit UITableView in the screen with AutoLayout

I am trying to fill the screen with a TableView. I've tried pinning 4 edges but it broke when I view it in different devices (iPad Pro, iPhone SE, landscape and portrait orientation). The TableView is messed up for some reasons. It shouldn't be this hard to fill that in. Did I messed up some settings in my Xcode?
If you ran the application on a real device you'll find it as you expect it to be.
And if you opened another file then came back to storyboard you'll find the preview as expected too, I think it's a bug in the UI Builder.
Note: I'm using Xcode Version 8.3.2.

Views in storyboard do not resize properly on iPhone 6

I've checked a lot of different websites and stackoverflow answers, and I'm still stuck.
I developed an app for iPhone and iPad targeting iOS 7.1. I have two storyboards, one for each device. The app only displays in portrait mode. I cannot seem to get the app to display full screen on the iPhone 6 simulator.
I've tried numerous things, I followed the advice linked here by adding a Launch Screen, setting the iPhone storyboard to auto layout and "use size classes", and . Not only does that not affect the size, but the Launch Screen doesn't seem to scale properly either. If I get it to fit the iPhone 6 it doesn't fit the iPhone 5 properly.
I've tried adding the proper launch images and I don't get any errors saying the wrong image resolution is present.
I've used the storyboard as a Launch Screen described here.
Now, when I switched to "use size classes" I could manually extend the objects in the views to match up with the size of iPhone 6 (I have not tested it for 6s) but that makes it extend past the iPhone 5 boundaries. The only thing I can think of right now is to create another storyboard and detect if it's iPhone 6, but I would really like some other ideas.
Here's what it looks like for iPhone 6:
And here's what it looks like on iPhone 5:
Best advice i can give u is
Use default size class , the classic 600x600 and then use Auto Layout
Or do the reverse, take a 3.5inch size VC and apply Auto Layout on it. Everything will present itself quite perfectly if you can apply the right constraints
Here is a link for an awesome Autolayout tutorial

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.

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