Xcode view controller 6 shows a blank screen with autostart

I am trying to use a view controller, which I decided to use for automatic layout. Before I used auto-layout, the view showed, as usual, how I intended this at runtime. But I decided to switch to automatic layout (because in the end, big iPhones go), and even after setting it up, without any problems, and seeing that the application scales well to the size of the iPhone in IB; I still have a blank screen. To prove this, here are the photos:

Xcode 6 shot. [] [1]

iOS Simulator shot. Note that the navigation bar and tab bars are showing.

So why is this happening? I have added limitations in the square view, and it gracefully scales to the look of the iPhone in Interface Builder. If you also look at the sidebar, there are no auto-layout error warnings. And IB does everything. But why is the simulator empty?

And yes, I have connected all the elements for the correct code. I checked. And yes, I have code that puts text in a shortcut. Here it is in the viewDidLoad () method:

override func viewDidLoad() { super.viewDidLoad() self.titleLabel.text = "Hello, World!" } 

And I will overestimate: the application worked before I did the automatic linking. For this assembly, I deleted all the elements, moved them, reconnected and added the modified view with the automatic IB module, which displayed it correctly. But I have different results.

Please help me. Oh, and sorry for the massive images, I can't figure out how to compress them.

EDIT: I went through and used a view debugger and tried to grab the view hierarchy to look for clipping or occlusion. It's pretty funny that the view debugger renders content correctly, and I have not seen cropping or occlusion. When I tried to show frames in the simulator, it did not show anything. I'm starting to think that this is a simulator error. I am currently using Xcode 6 beta 6.

+10
ios xcode autolayout swift
source share
3 answers

I recreated the problem by adding the collection view to the standard view controller, and this seems to be the problem:

Constraints added when selecting "Add suggest constraints"

enter image description here If Xcode adds the suggested restrictions, you will get this, which is why the view will not be displayed.

It aligns the view left and right along the layout guides (which seems wrong)

You will need to manually add distance limits for your view.

Is this what you want:

enter image description here

+2
source share

Try turning on the editor assistant and use the preview by changing the restrictions.

Screenshothot
(source: mattknott.com )

+1
source share

Make your editing in WAny hAny For All Layouts Base values ​​mode. then when testing on different devices you will not see a blank screen.

The mode selection can be one of the bottom panel. Good luck

0
source share

All Articles