1
我需要编辑的ImageView的绝对值:Android Studio中的约束布局的变化绝对
tools:layout_editor_absoluteY="0dp"
到
tools:layout_editor_absoluteY="50dp"
但在Java中,如果我只是做
ImageView img = (ImageView)findViewById(R.id.mainView);
ConstraintLayout.LayoutParams params1 = (ConstraintLayout.LayoutParams)(img.getLayoutParams());
params1.editorAbsoluteY = 50;
img.setLayoutParams(params1);
它不”工作。
“它不起作用”意味着它不会做改变的价值。 – Vexorei