How To Fit UITableView in the screen with AutoLayout - ios

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.

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

Same Storyboard for different screen Sizes without Auto Layout

I've been using different storyboard for different screen sizes.
Now, I'm updating an old app with only one Storyboard for iPhones and it looks the same appearance as iPhone 5 in different iPhone simulators, without using auto layout. Works well on iPhone6 and 6 plus Simulator.
Can I trust this behaviour or is any simulator bug? Is it due to any Properties project config ?
You must use auto-layout otherwise it will not work 100%. If you enable auto resize subviews option in storyboard view then it might work upto some extent.
I got it... Just not setting any launch screen image for the devices without defined storyboard

Why is my App always shifted to the right in the iOS Simulator?

I am building a simple iOS app using Storyboards. Currently running Xcode 7.2.1. I have previously built one using .XIB files and never had an issue with layouts on devices.
I have a UIViewController that has a UINavigationBar and Bar Button Item. When I run the app in the simulator, everything looks shifted to the right and partly off screen. The title should be shown in the centre. I am simulating using iPhone 6 and everything in Simulated Metrics are set to Inferred. Could someone help me understand, am I missing a step?
The views are shifted because you didn't set the auto layout constraints. To fix this, add missing constraints.

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

iPad screen doesn't support autolayout

I have created view using autolayout it works fine in all iPhone devices but it left some blank space at left, right, top and bottom on iPad.I tried to make another xib specially for iPad which is 768*1024 but still facing same problem.
here is the screenshot of iPad output.
The problem is that you forgot to make this a universal app. So it is running on the iPad in emulation mode as an iPhone app in a reduced frame.

Resources