ConstraintLayout 東西不新了,但是使用上有坑,記錄下。
- 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的。然后你就會發(fā)現(xiàn),各種蛋疼找不到這玩意。我在這記錄下AS 3.0的使用方法。
首先你得到Components Tree下,找到ConstraintLayout中你報錯的控件,記住不是ConstraintLayout,而是報錯控件!

選中前

選中后
好了第二張圖中紅框就是你們心心念念的infer Constraints。
PS:要轉的請放個原連接地址,=。=