I have the dreaded warning Attribute Unavailable: Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0
, but in my case, Margin
does not appear in the storyboard, and the label in question (the one that is highlighted when I click on the warning) has no constraints. In fact, the entire view has no constraints.
I have seen other posts, eg. Attribute Unavailable warning on iOS versions prior to 8.0, but as I said no Margin
to find, and no constraint to edit.
I will add constraints and hope it goes away, but it looks like another bug...
To create constraints select the button and click the Align icon in the auto layout menu. A popover menu will appear, check both “Horizontal in container” and “Vertically in container” options to center the button on the screen. Then click the “Add 2 Constraints” button. Run the application.
Basically if the layout margins are 8,8,8,8 (the default), a constraint with 0 leading space to container margin will have an x position of 8. Note that this is only available on iOS8 or later.
You can correct this by pressing Command + Option + = or selecting "Update Frames" in the |-•-| menu (I think it looks like a tie fighter).
I think I've seen the same things for UILabels in Interface Builder. For me, the warning goes away by checking this box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With