Why my Xcode interface builder show red block and failed to render - ios

Problem
I have a Controller in Storyboard which has a long UIScrollView inside. Previously it shows perfectly in Interface Builder and now I haven't changed the code. The last time I knew that I updated Xcode to version 11.0. I don't quite know why it fails to render, is it some issue in Xcode 11?
If I compiled, it's success with 0 error and some warning (Which seems me to some Swift deprecated). Even it shows perfectly in Compiled App. I have tried:
Clean Build
Delete Derived Data
Reopen Xcode
Rebuild
Restart OS
Edited after some experiment
Okay, so I tried a bunch of things again and I think I narrowed some problem (maybe?). So my layout show perfectly in iPhone 11 preview, but it fail to render in iPhone 11 Pro Max, iPhone 11 Pro and iPhone 8 Plus preview. Is it ringing any bell?
iPhone 11 screenshot:
iPhone 11 Pro Max screenshot:
iPhone 8 Plus screenshot:

Obviously a change in storyboard previews in Xcode. Seems like it's no longer acceptable to show "simulated size: freeform" greater than iPhone screen height. Changing it to "simulated size: fixed" in Size Inspector solves the issue, and you can now scroll from within the reduced size window in storyboards view...

Related

Xcode 8.2 Interface Builder Update Frame & Constraint Issue

I recently updated from Xcode 7.3 to 8.2. I was using autolayouts and size classes in Interface Builder in 7.3 and everything worked fine. Now in 8.2 the IB preview doesn't correctly represent the positions of the views. However when I run it on a device or a simulator it looks fine. But if I update frames or update constraints in the preview everything gets jumbled up.
Is there anything I can do to stop update frames or update constraints mucking everything up?
Near the Stack button, there is a new "Update frame" button, its just left to the stack button
I worked out what the problem was. There was nothing wrong with the constraints I had. The issue was that in Xcode 7 the storyboard was in ipad size. Initially when I loaded the project in Xcode 8, it opened to view as iphone 7 plus size. When I changed the storyboard to view as ipad pro size and updated frames it fixed everything. And then when I changed to view as iphone 7 plus size it resized everything perfectly as it should have done in the first place.

iOS simulator window height difference between 7.1 and 8.3

I didn't find any solution for my problem anywhere in Stack Overflow or other sites. So here is the problem:
I am developing an iOS Universal app, portrait orientation only. When I run it on iOS 8.3 simulator window and all other views layout seems to be normal.
But when I run the same app on iOS 7.1 simulator, which I downloaded from developer's site for Xcode 6, the window height seems to be approximately 100 px smaller.
I checked the couple of view frames for both simulators.
7.1 simulator was returning width = 320, height = 480
8.3 simulator returned width = 320, height = 568
I am using storyboard and constraints.
I am pretty sure that a lot of people had this problem, so I am hoping to hear some useful advices from you.
Check out the screenshots below:
Added Answer as per Brian Tompsett - 汤莱恩's Suggestion.
Solution is already done on comments.
iOS 7.x does not support LaunchScreen.xib
So, Manually add the LaunchScreens in the assets folder and you will get desired output.
Go to Project settings --> Target --> App Icons and Launch Images
Launch Image Source was empty so, open it and chose to Migrate from Images.
So now window height is back to 568 on iOS 7.1 simulator

iPhone 5 storyboard still shows padding when running on iPhone 5

I have made a new app with storyboard, where the storyboard is currently just for iPhone 5. But the issue is, when I run this on iPhone 5 device/simulator, it shows padding at the top and bottom of the screen as if an iPhone 4 application is being run. Please see the screenshot I have attached. And help where did I go wrong.
EDIT : Actually its still not working. In iOS 8 its coming fullscreen but in iOS 7 for some reason the black padding is coming. PLease hellpppp.
EDIT - I got the issue.Apparently, in xcode 6, when Launchscreen.xib is given, it does not work for ios 7 and it works perfectly normal for ios8.
Previous answer - The issue was, in Xcode 6.0, the new project generates a LaunchScreen.xib file, but apparently you manually have to go to the General settings for the target and select the launch screen File options from the drop down. This solves the issues. :)

Stretched interface on iPhone 6

On my iPhone 6 Simulator (not iPhone 6 Plus) the interface looked stretched. I can't figure out why.
I created a clean new project and started the simulator and there the interface looks normal. Here is a screenshot:
So I copied the storyboard of the new project into my current project and started the simulator with the new storyboard. There it looked stretched up again:
What could be the problem?
I found out what the problem was: There was no launch image (or a launch screen file) provided in my Xcode settings.
If that is the case the iPhone will resize the user interface.

iOS Development Simulator view squashed

I have just started iOS programming and am following a tutorial on iTunesU from Stanford.
In the first tutorial we were shown how to build a simple RPN calculator. When I built and compiled in the simulator launched as normal but everything was "squashed". I figured this was because the View in XCode is bigger than the iOS simulator. How can I resize the view in Xcode or am I missing something.
Here is the iOS simuator view compared with the one from xcode
Looks like your view in Xcode's Interface Builder is a 4" view, and the simulator is running a 3.5" device. You can change either one.
The view size in Xcode is changeable by selecting the entire view, and in the attributes inspector, you can change the size between Freeform, 3.5, 4.
You can change the device in the simulator by going to Hardware>Device> Select your device
However, the overlapping buttons, etc, are more related to using Auto Layout, or misused struts. You can either turn off Auto Layout and use struts, or take the challenge to learn Auto Layout.
Here's a start for Auto Layout: What is Auto Layout?
It's not 'squashed' you are using the device simulator for the latest iPhone, which has a 4 inch display instead of 3.5 inch. To change device go to Hardware->Device in the simulator bar. And the iPhone frame does not show in the latest version of the simulator so to press the home button you go under Hardware->Home.

Resources