-1

Now,here is my question.

enter image description here

how can I use ConstraintSet's connect to set attr like 'app:layout_constraintBottom_toBottomOf="parent"'

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108

1 Answers1

0

Try this

TextView textView = new TextView(this);
textView.setId(R.id.text_id);
ConstraintSet set = new ConstraintSet();
set.clone(constraintLayout);
set.connect(textView.getId(), ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM, 0);
constraintLayout.addView(textView);
set.applyTo(constraintLayout);
Hai Hack
  • 948
  • 13
  • 24