Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot equal height to Superview in Xcode 11

I upgraded my Xcode today to 11 and just realised that Xcode doesn't allow me to create proportional height from a sub view to the view controller's root view anymore. I was able to do it till this morning with the previous Xcode version. The only workaround is to add another sub root view to the controller and move everything under it. This option will take too much time to re-design the setup the controller.

Are you experiencing the same problem?

This is from the new Xcode 11. As you can see there is no equal height or width option to superview anymore.

enter image description here

And this pic is from one of my Views that I created it's constraint in previous Xcode. As you can see there is a proportional constraint equals to the ViewController's superview with 0.65 ratio.

I don't wanna add a mid root view to the view controller. It will be just a time wasting process. Any ideas? Am I missing a new magic button or +?

enter image description here

like image 284
thus Avatar asked Sep 25 '19 19:09

thus


People also ask

How do you add equal width constraints?

To add equal width constraint, you will need to select both views by command clicking on both of them. Then click on the pin menu and the previously grayed out Equal Width checkbox is now available. Click on that and click Add 1 Constraint.

What is aspect ratio constraint in Xcode?

Aspect ratio constraint is used to control the width and height of a view as per a aspect ratio that you set here. There are some standard presets such as 1:1 which means width will be equal to height. Similarly other presets calculates the dimensions based on a ratio.

What is Nslayoutconstraint in Swift?

The relationship between two user interface objects that must be satisfied by the constraint-based layout system.


1 Answers

You can set your view equal to the Safe Area.

enter image description here

If you still rely on having it equal to the root view itself, you can modify the constraint in the Attributes Inspector:

enter image description here

like image 110
Eilon Avatar answered Sep 20 '22 02:09

Eilon