ConstraintLayout 出来蛮久了,但是一直没怎么用,说是可以直接进行拖拽来实现布局,但是 xml 里全是写死的 dp,不实用。然后用代码吧,属性都贼长贼多,有些难记。最近同学强力安利,说多写写就熟悉了,于是项目新的布局基本都用 ConstraintLayout 来写了,刚开始写的时候确实比较慢,很多属性不知道,有些属性有什么用也不晓得,但是用了几天后,发现真好用!人类的本质啊,真香怪!
基本属性
- layout_constraintRight_toLeftOf
- layout_constraintRight_toRightOf
- layout_constraintLeft_toLeftOf
- layout_constraintLeft_toRightOf
- layout_constraintTop_toTopOf
- layout_constraintTop_toBottomOf
- layout_constraintBottom_toTopOf
- layout_constraintBottom_toBottomOf
- layout_constraintBaseline_toBaselineOf



