我需要以编程方式修改 RelativeLayout 的上边距
myScrollView.marginTop = 250
不幸的是,我收到错误val cannot be reassigned
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
...
<RelativeLayout
android:id="@+id/myScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="100dp"
android:layout_marginRight="100dp"
android:layout_marginTop="125dp"
tools:context=".QuizActivity">
...
请问有不同的方法吗?
提前感谢您的帮助。