页首Html代码

Android ConstraintLayout的使用(二)

https://www.jianshu.com/p/502127a493fb

 

https://www.jianshu.com/p/f110b4fcfe93

 

View 的尺寸

app:layout_constraintWidth_default

有三个值

spread,当layout_width设置为0dp的时候,View会在约束的方向扩张。

percent  需要设置

layout_constraintWidth_percent

比如为0.4,该View 的宽度就是父View的0.4倍。

 

 

设置View 的宽高比

其中一个设置为0dp,

然后app:layout_constraintDimensionRatio="2:1"

 

posted @ 2020-02-26 20:09  noigel  阅读(129)  评论(0编辑  收藏  举报
js脚本