layout_constraintWidth_percent in java
在xml里写的layout_constraintWidth_percent=“0.4”app:layout_constraintWidth_default="percent"app:layout_constraintWidth_percent="0.4"在java中可以这样写mConstraintLayout = (ConstraintLayout) findViewById(R.id.mycon
·
在xml里写的layout_constraintWidth_percent=“0.4”
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.4"
在java中可以这样写
mConstraintLayout = (ConstraintLayout) findViewById(R.id.myconstraint_layout)
ConstraintSet set = new ConstraintSet();
set.connect(子view的id, ConstraintSet.TOP, ConstraintLayout的id, ConstraintSet.TOP);
set.constrainPercentHeight(子view的id, 0.4);
set.constrainPercentWidth(子view的id, 0.4);
set.applyTo(ConstraintLayout对象实例);
更多推荐
已为社区贡献1条内容
所有评论(0)