Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto Layout in Xcode 6 - Pinning view to edge of parent view creates -8 constraint

In Xcode 6 when I try to pin an image view to the edge of UICollectionViewCell, auto-layout creates constraints of -8.0. What changed? I've tried to find release notes or documentation updates but haven't seen anything.

  1. Notice the imageview is up against the edges of the collectionview cell

image

  1. Frame X and Y are both zero

frame

  1. Adding constraints for leading space and trailing space to container margin results in a settings of -8.0

constraints

Why is this happening and what is the preferred approach for edge to edge content?

like image 908
Kyle Clegg Avatar asked Sep 10 '14 23:09

Kyle Clegg


1 Answers

Before you add a new constraint, you will need to untick the "Constain to Margins". It is ticked by default.

enter image description here

like image 123
Ricky Avatar answered Nov 09 '22 21:11

Ricky