Zana Daniel
Zana Daniel

Reputation: 301

Why is Xcode constraints doing this to my app?

Screenshot of my issue

Screenshot of the "=" button constraints

Can somebody please help me understand why the Xcode auto layout constraints keep cutting the bottom buttons? All the buttons heights are 50 and for some reason any button on the bottom gets cut. (I have shown a screenshot of my screen)

Any help would be greatly appreciated. Thank you.

Upvotes: 1

Views: 101

Answers (4)

s1ro6
s1ro6

Reputation: 160

There is a wrong Constraint: "Bottom space to ....". In your case, the "=" button's height is NOT fixed.

You should change this constraint to "Height Equals: 50" or equals to another button.


The last, excuse me for any mistakes since my not-so-good English.

Upvotes: 0

Bhavin Bhadani
Bhavin Bhadani

Reputation: 22364

As I said in comment you need to remove bottom constraint from button something like this image ... select constraint and delete it and than add height constraint

enter image description here

So now your constraints would be top , leading , trailing and fixed height

Upvotes: 1

Twitter khuong291
Twitter khuong291

Reputation: 11672

The = button should set its height = 50 instead of set the constraint to the bottom of super view .

Remove Bottom space to: Bottom Layout Guide. Then drag the = button like this

enter image description here

Then choose height

enter image description here

and edit it to 50.

Upvotes: 1

Ketan Parmar
Ketan Parmar

Reputation: 27428

You should not give bottom constraint in this case. your button's constraint should be like,

leading, trailing, top and fix height

Upvotes: 1

Related Questions