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

前端 未结 7 2150
[愿得一人]
[愿得一人] 2020-12-02 12:12

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

Attribute Unavailable: Layout attributes relative to the layou

7条回答
  •  死守一世寂寞
    2020-12-02 12:29

    I took a non programmer approach.

    I knew which view controler was causing the 8.0 margin message. So, I went to my constraint list. I had 33. I've remove every one that was causing the 8.0 margin message. I went down to 20 (So 11 was problem).

    Select 32 over 33 delete and see the result. Select 31 over 33 delete and so on ... Naturally when the message still there ... delete the problematic one.

    So it took me 5 minutes to resolve the error message.

    Other constraint messages did appear but that's not a big deal.

    Ok than, redo and resolve step by step the constraint messages but this time check that all the constraint you add don't provoke the reappearing of the 8.0 margin message. If so, undo and take an other strategy when adding constraints. There's always an other way to add a constraint that work.

    That's not what is proposed by Xcode but it will do the job.

    At the end, your done.

    If you have more than one view controller, and don't know witch one is causing the 8.0 margin message, try to isolate each view controller. May be in a separate test project with a copy and paste or deleting all the other view except one and se the result.

    Using the "Create Snapshot" in the file menu can help you if something goes wrong.

提交回复
热议问题