2017-08-28 164 views
-2

简单问题:ConstraintLayout绘制顺序/层为了

什么是为了知道使用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> 

回答

1

好的。我现在解决了。

显然按钮被分开处理。随着海拔升高到最高点。

解决方法是在你的按钮删除此标高,写这篇文章的xml文件:

机器人:stateListAnimator = “@空”