【发布时间】:2018-07-19 10:57:22
【问题描述】:
对于 Android 中的约束布局 v1.1.x,我们可以将高度和宽度设置为百分比。 同样,需要以编程方式在 Android 中将视图宽度和高度设置为百分比: 例如,这段代码是用 xml 编写的,用于一些约束布局:
<!-- the widget will take 40% of the available space -->
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.4"
运行时的 java 代码是什么?
【问题讨论】:
标签: java android android-constraintlayout