title: AutoLayout works in ios 8 but not in ios 7?
body: <p>I am using autolayout within a UICollectionViewCell. Super simple layout: just a UILabel. I want the UILabel to take up the full width minus a 20 px inset and be centered in the cell both vertically and horizontally. I have set up constraints that do just that. If i run it on any ios 8 device or simulator it works perfectly. However, when I run it on some ios 7 devices the constraints have no effect. I tried looking through the apple docs, but none of their changes seems to be around auto layout. </p>
  
  <p>Here's the XML source code though I doubt it means much:</p>
  
  <pre><code>&lt;constraints&gt;
              &lt;constraint firstItem="OIc-cg-9hO" firstAttribute="leading" secondItem="Ga6-nx-lOn" secondAttribute="leading" constant="20" id="A7U-sd-fcL"/&gt;
              &lt;constraint firstAttribute="centerY" secondItem="OIc-cg-9hO" secondAttribute="centerY" id="G9e-9W-aDS"/&gt;
              &lt;constraint firstAttribute="centerX" secondItem="OIc-cg-9hO" secondAttribute="centerX" id="TrB-hI-7Kw"/&gt;
              &lt;constraint firstAttribute="trailing" secondItem="OIc-cg-9hO" secondAttribute="trailing" constant="20" id="yjH-nf-D9U"/&gt;
          &lt;/constraints&gt;
  </code></pre>
  
  <p>More of a workaround than an answer: but I added the constraints in code as follows:</p>
  
  <pre><code>    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.cellName
                                                        attribute:NSLayoutAttributeWidth
                                                        relatedBy:NSLayoutRelationEqual
                                                           toItem:self
                                                        attribute:NSLayoutAttributeWidth
                                                       multiplier:1.0
                                                         constant:-20.0]];
  
  [self addConstraint:[NSLayoutConstraint constraintWithItem:self.cellName
                                                        attribute:NSLayoutAttributeCenterX
                                                        relatedBy:NSLayoutRelationEqual
                                                           toItem:self
                                                        attribute:NSLayoutAttributeCenterX
                                                       multiplier:1.0
                                                         constant:0.0]];
  
  [self addConstraint:[NSLayoutConstraint constraintWithItem:self.cellName
                                                        attribute:NSLayoutAttributeCenterY
                                                        relatedBy:NSLayoutRelationEqual
                                                           toItem:self
                                                        attribute:NSLayoutAttributeCenterY
                                                       multiplier:1.0
                                                         constant:0.0]];
  </code></pre>
  
  <p>In order for it to work I needed both the coded constraints and the IB constraints. Dunno Why!</p>