1
私は、テキストビューを親の右端に以下のコードで追加しようとしています。しかし、それは動作していません。制約レイアウトでlayout_constraintEnd_toEndOfをプログラムで達成する方法は?
ConstraintSet constraintSet = new ConstraintSet();
TextView mValue1 = new TextView(getContext());
mValue1.setText("Value 1");
mValue1.setId(R.id.rightLabel1);
addView(mValue1);
constraintSet.clone(this);
constraintSet.connect(mValue1.getId(), ConstraintSet.TOP, this.getId(), ConstraintSet.TOP);
constraintSet.connect(mValue1.getId(), ConstraintSet.END, this.getId(), ConstraintSet.END);
constraintSet.applyTo(this);