【发布时间】:2021-08-18 15:02:14
【问题描述】:
您好 Stack Overflow,我是 Android 新手!
我正在设计两个按钮,其中一个在另一个按钮上方,就像 Photoshop 中的两个图层。
Button ONE position in Android XML editor
我还不能嵌入照片!
这里是按钮ONE:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="84dp"
android:background="@drawable/empty_yellow_circle"
android:text="1"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />
Button TWO position in Android XML editor
这里是按钮TWO:
android:id="@+id/button2"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginStart="76dp"
android:layout_marginTop="48dp"
android:background="@drawable/full_yellow_circle"
android:text="2"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="@+id/button1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.558"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/button1"
app:layout_constraintVertical_bias="1.0" />
我想要什么?
我想把这个按钮安排为上面的照片,按钮ONE 总是卡在按钮TWO 下方并且永远不会出现在按钮TWO 上方,就像两个固定层。
但在测试运行中,当我点击按钮ONE时,它会出现在按钮TWO的上方,反之为链接照片 > 下面。
When Click on Button ONE and vice
您可以在该按钮上方的照片中看到
ONE边框位于按钮TWO文本上方。
所以它们不是固定的层,每次点击都会改变排列。 我想要一个固定的安排。
感谢您的帮助!
【问题讨论】:
标签: java android xml kotlin layer