我正在使用约束布局,并且有这样的视图
<View
android:id="@+id/view_separator_line"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="32dp"
android:background="@color/grey_dark_low"
app:layout_constraintEnd_toEndOf="@+id/imageView_gear_setting_user_information"
app:layout_constraintStart_toStartOf="@+id/imageView_following_profile_picture"
app:layout_constraintTop_toBottomOf="@+id/imageView_following_profile_picture" />
正如您从上面的xml中看到的那样,此视图的顶部被约束到另一个视图的底部,并且布局边距的顶部为32dp,我想以编程方式将其更改为24dp,该怎么做?
请尝试以下代码