Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are margins in Storyboard, and why does the iPhone 6 plus have different side margins than the other iPhones?

When creating constraints in my views in Xcode 6, I noticed this "constrained to margin" box which is ticked by default:

enter image description here

The result of keeping this box ticked is that I the app would run normally on all iPhones except iPhone 6 Plus where I would have some margins on the left and right of the view:

iPhone 6iPhone 6+

I tried looking at Apple's documentation, but maybe not hard enough. What is margin in Xcode 6 and above? Why is the margin only on the sides and not on the top/bottom? And why is it that only iPhone 6 Plus has this margin? Why not iPhone 6 and others? Are those margins documented somewhere?

like image 677
Enrico Susatyo Avatar asked Oct 19 '22 19:10

Enrico Susatyo


1 Answers

You need to click "relative to margin" in the horizontal space constraint attributes

enter image description here

like image 86
stone Avatar answered Dec 05 '22 07:12

stone