-2
什么是为了知道使用ConstraintLayout精确算法图绘第一和图绘最后?
在RelativeLayout中,XML文件中的最后一个视图是最后绘制的,因此它将位于所有内容之上,遮挡了先前绘制的视图。
为什么ConstraintLayout不具有相同的功能(至少,显然)?
以下代码导致Button显示在包含的视图的顶部。
<Button
android:id="@+id/calculate"
android:layout_width="183dp"
android:layout_height="76dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:text="C A L C U L A T E"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<include
android:id="@+id/help_window"
layout="@layout/help_window"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include4" />
</android.support.constraint.ConstraintLayout>