Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout attributes relative to the layout margin on iOS versions prior to 8.0

Tags:

ios

autolayout

What would be causing the following warning (and subsequent alignment issues on iOS 7)?

Attribute Unavailable: Layout attributes relative to the layout margin on iOS versions prior to 8.0

like image 390
Andy Avatar asked Aug 12 '14 09:08

Andy


2 Answers

None of the posted answers solved the problem for me. But the reason for this is the following: Xcode 6 creates constraints based on relative margins by default. Those are only available on iOS 8.0 and newer. You get these warnings when your deployment target is set to iOS 7.0 or lower.

The way I fixed the warning:

  • Click the warning in Xcode
  • Attribute inspector will open the constraint
  • Search for item that has margin (see screenshot)
  • Turn off Relative to margin option

Attribute inspector

like image 103
Legoless Avatar answered Sep 25 '22 19:09

Legoless


Disable "Prefer margin relative"

enter image description here

like image 21
Andy Avatar answered Sep 25 '22 19:09

Andy