Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Constrain to margin isn't working properly on Xcode

I'm trying to set a constrain of "0" to a UIImageView from the sides (left & right) but when I add the constrain with "Constrain to margin" checked, it pins the image all the way to the edge of the ViewController while it should keep some distance, why is this happening?

like image 510
Eihab Avatar asked Sep 25 '17 17:09

Eihab


1 Answers

I was having the same problem and recently resolved the issue by turning off the safe area. Safe Area Layout is enabled by default. To disable Safe Area Layout in Xcode 9, choose View > Utilities > Show File Inspector and deselect the checkbox for Use Safe Area Layout Guides. This should correct the issue. Good luck, hope it helps.

like image 109
Udenihc Avatar answered Sep 20 '22 02:09

Udenihc