美文网首页
利用自动适配时,视图没有父视图时报错

利用自动适配时,视图没有父视图时报错

作者: 舟_e9ce | 来源:发表于2019-03-15 09:09 被阅读0次

    Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors <NSLayoutYAxisAnchor:0x6000021743c0 "UITableView:0x7fb06a2b0200.top"> and <NSLayoutYAxisAnchor:0x600002174780 "HDWPigeonPlatform.TabBarLineView:0x7fb0695d3b00.bottom"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.'

    当A视图添加在父视图上,B视图未添加在父视图上时,而A视图引用了B视图,找不到B视图的父视图,也就是说没有一个固定的锚点,没有一个相对约束,从而报错

    相关文章

      网友评论

          本文标题:利用自动适配时,视图没有父视图时报错

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