美文网首页
使用Masonry遇到的错误

使用Masonry遇到的错误

作者: 罗小耳 | 来源:发表于2015-12-10 18:12 被阅读4566次

    错误原因:

    在使用自动布局时,不断的报下面的错误:Unable to simultaneously satisfy constraints.Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) (    "",    "",    "",    "",    "")Will attempt to recover by breaking constraintBreak on objc_exception_throw to catch this in the debugger.The methods in the UIConstraintBasedLayoutDebugging category on UIView listed inmay also be helpful.


    可能出错原因:

    1,你的约束的确设置错误;

    2,忘记设置控件的:setTranslatesAutoresizingMaskIntoConstraints 等于NO 。

    3,骚年,快回头看看你的代码,是不是哪里手懒,没用alloc初始化,用的是new啊,改回alloc初始化控件即可。


    相关文章

      网友评论

          本文标题:使用Masonry遇到的错误

          本文链接:https://www.haomeiwen.com/subject/hwbzcttx.html