我想以编程方式在ConstraintLayout
内为ConstraintSet
添加一些约束。我知道我必须使用layout_constraintRight_toLeftOf
,但我不知道如何在android中的Java textView
中添加xml属性:angular.module("core")
.filter('runTimePlusSetup', function () {
(及其等价)。
任何帮助表示赞赏!!
答案 0 :(得分:1)
您可以这样设置,
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(layout); // root layout
// If you want to align parent to the layout left
constraintSet.connect(textView.getId(), ConstraintSet.LEFT, layout.getId(), ConstraintSet.LEFT);
// If you want to align to the left of one more textview - second text view
constraintSet.connect(textView.getId(), ConstraintSet.RIGHT, textView1.getId(), ConstraintSet.LEFT);
/*______________________________
| Text1 Text2 |
| |*/
constraintSet.applyTo(layout);