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

2019-03-15  本文已影响0人  舟_e9ce

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视图的父视图,也就是说没有一个固定的锚点,没有一个相对约束,从而报错

上一篇下一篇

猜你喜欢

热点阅读