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

前端 未结 7 2139
[愿得一人]
[愿得一人] 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:25

    Xcode 6 creates constraints based on relative margins by default.

    So, if you want to force remove all baselines attributes and don't want to search all bad constrains in Interface Buidler, to support iOS 7, I can recommend this way

    To find and remove all dummy strings with "Baseline" in constraints you can do this:

    1. Close Xcode
    2. Open your stroyboard file in your favorite text editor, that supports regexp.
    3. Find and remove from storyboard file all strings by pattern: .*"baseline".*\n
    4. Now save file and open it in Xcode
    5. Fix all appeared misaligns: find all warnings and press "Update constraints for all views" to save original position of all views.
    6. Profit!

    UPD: I found that "baseline" constraints causes crashes also, but Xcode doesn't show any warnings about these constrains!

    To fix it - remove from storyboard file all strings by pattern: .*"baseline".*\n

提交回复
热议问题