美文网首页
iOS不同系统的区别,注意点

iOS不同系统的区别,注意点

作者: delims | 来源:发表于2019-08-22 13:41 被阅读0次

总结一下开发过程遇到的特殊情况,需要注意的点

iOS9-iOS11的系统使用Xib布局cell,设置UITableViewAutomaticDimension自动计算高度时会提示如下的错误。解决办法,可以给其中一个高度约束设置priority小于1000。iOS12的系统不会出现此错误提示。

2019-08-22 13:29:16.973702+0800 BoChuang[58487:1511846] [LayoutConstraints] 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. 
(
    "<NSLayoutConstraint:0x600000092890 UIImageView:0x7fe453f7dfe0.height == 48>",
    "<NSLayoutConstraint:0x600000092520 UIView:0x7fe453f37590.height == 10>",
    "<NSLayoutConstraint:0x60000008eb50 UIImageView:0x7fe453f7dfe0.top == UITableViewCellContentView:0x7fe453f55220.top + 10>",
    "<NSLayoutConstraint:0x600000094230 UIView:0x7fe453f37590.top == UIImageView:0x7fe453f7dfe0.bottom + 10.5>",
    "<NSLayoutConstraint:0x600000094280 UITableViewCellContentView:0x7fe453f55220.bottom == UIView:0x7fe453f37590.bottom>",
    "<NSLayoutConstraint:0x600000094aa0 UITableViewCellContentView:0x7fe453f55220.height == 78.6667>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600000092890 UIImageView:0x7fe453f7dfe0.height == 48>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

相关文章

网友评论

      本文标题:iOS不同系统的区别,注意点

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