Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute Unavailable warning on iOS versions prior to 8.0

What's causing this warning in the interface builder?

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

I'm using the XCode 6 Beta. The warnings are pointing to lines in the xml source that do not concern attributes.

like image 789
GLee Avatar asked Aug 12 '14 23:08

GLee


3 Answers

Since I had already created the constraints, the answer was to click on the constraint, and then look in the Utilities bar (on the right). As shown in the picture below, click on an item and then make sure that "relative to margin" is unchecked.

Relative to margin screenshot

like image 69
GLee Avatar answered Nov 01 '22 17:11

GLee


When you add constraints in Xcode 6, you have the option "Constrain to margins" which create a different constraint and can't be read, for example, in Xcode 5. Create the constraints without this options and the warnings should go away. This constraints will be available on iOS 8.

enter image description here

If you have already created the constraints, we can change it clicking on the constraint and editing it. When selecting the second item, you can uncheck the "Relative to margin" option (as explained in the GLee answer.

like image 13
Tchelow Avatar answered Nov 01 '22 17:11

Tchelow


If you can't find where the warning is coming from you can use this grep to find it.

Run this in Terminal in your project directory:

grep -C 6 -nr Margin .

The 6 says how many lines of context to show before and after the match.

like image 11
Collin Avatar answered Nov 01 '22 18:11

Collin