Xcode 6 auto-layout - Snap to edge of parent view creates -8 constraint

In Xcode 6, when I try to snap an image to the edge of a UICollectionViewCell , auto-layout creates a -8.0 constraint. What changed? I tried to find release notes or documentation updates, but didn't see anything.

  • Notice that the image faces the edges of the collection cell.

image

  1. Frame X and Y are zero

frame

  1. Adding constraints for the leading space and trailing space in the container field results in -8.0 settings

constraints

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

+5
source share
1 answer

Before you add a new constraint, you need to disable " Constain to Margins ". By default, it is checked.

enter image description here

+8
source

Source: https://habr.com/ru/post/1202287/


All Articles