Как установить ширину просмотра в процентах, используя код - PullRequest
0 голосов
/ 30 октября 2019

Я так понимаю:

<Button
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_constraintWidth_percent="0.2" />

Как написать код вроде:

Button cmd = new Button( context);
cmd.set layout width = "wrap_content"
cmd.set layout height = "0dp"
cmd.set layout_constraintWidth_percent = "0.2"
...