我有一个ConstraintLayout
带有几个元素和两个按钮的。
我试图通过使用顶部和底部约束并使用偏差属性将按钮放在底部以获取底部/左/右对齐。
一切都在编辑器 ( Android studio 2.2 P3
) 中正确显示,但是当我运行应用程序时,没有任何内容正确显示。
任何帮助都将不胜感激。
以下是相关章节layout XML
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/relativeLayout"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
...snip...
<Button
android:text="Reset"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_constraintLeft_toLeftOf="@+id/relativeLayout"
app:layout_constraintBottom_toBottomOf="@+id/relativeLayout"
android:layout_marginBottom="16dp" />
<Button
android:text="Apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/profile_apply_button"
app:layout_constraintLeft_toLeftOf="@+id/relativeLayout"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
app:layout_constraintTop_toTopOf="@+id/relativeLayout"
android:layout_marginTop="16dp"
app:layout_constraintRight_toRightOf="@+id/relativeLayout"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="@+id/relativeLayout"
android:layout_marginBottom="16dp"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintVertical_bias="1.0" />
</android.support.constraint.ConstraintLayout>