如果我有这样的约束布局
<android.support.constraint.ConstraintLayout >
<TextView
android:layout_width="200dp"
android:layout_height="50dp"
android:text = "Some text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/preview"
app:layout_constraintTop_toTopOf="@+id/parent">
/>
<Button
android:layout_width="57dp"
android:layout_height="281dp"
app:layout_constraintBottom_toBottomOf="@+id/textview"
app:layout_constraintEnd_toEndOf="@+id/textview"
app:layout_constraintStart_toStartOf="@+id/textview">
/>
</android.support.constraint.ConstraintLayout>
其中 textview 是另一个小部件。然后这将使按钮和 TextView 底部边界对齐。
有没有什么地方可以将按钮按下 10dp?所以我希望按钮底部锚定到 textview 的底部,但是我想将其向下推 10dp。我试图设置 android:layout_marginBottom="-10dp"但这没有用! 有什么想法吗?
最佳答案
在按钮布局中使用 android:layout_marginTop="10dp"
关于android - 对齐 2 个 View 底部,但一个被进一步推低,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53052154/