美文网首页
ConstraintLayout的一二三

ConstraintLayout的一二三

作者: Cloke73 | 来源:发表于2018-05-09 16:53 被阅读22次

ConstraintLayout 东西不新了,但是使用上有坑,记录下。

  1. This view is not constrained horizontally: at runtime it will jump to the left unless you add a horizontal constraint

这个问题解决非常简单,无论百度还是谷歌都会回答你使用infer Constraints。不过能找到的大多数都是基于AS 2.2的。然后你就会发现,各种蛋疼找不到这玩意。我在这记录下AS 3.0的使用方法。

首先你得到Components Tree下,找到ConstraintLayout中你报错的控件,记住不是ConstraintLayout,而是报错控件!


选中前 选中后

好了第二张图中红框就是你们心心念念的infer Constraints。

PS:要转的请放个原连接地址,=。=

相关文章

网友评论

      本文标题:ConstraintLayout的一二三

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