あなたは電子メールのラベルのウィジェットではConstraintLayout
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/email_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EMAIL"
android:textSize="22sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.2" />
<EditText
android:id="@+id/email_input"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_margin="16dp"
android:background="@android:color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/email_label" />
<TextView
android:id="@+id/pwd_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="PWD"
android:textSize="22sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/email_input" />
<EditText
android:id="@+id/pwd_input"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_margin="16dp"
android:background="@android:color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pwd_label" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LOGIN"
android:textSize="16sp"
android:layout_margin="16dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pwd_input" />
</android.support.constraint.ConstraintLayout>
を使用して達成したいものだ、あなたはまた、「layout_constraintVertical_bias」と「layout_constraintBottom_toBottomOf」属性を削除し、上の余白を修正することができます。
これはチェーンを使用して行うこともできます。
ConstraintLayout 1.0.2を使用していることを確認してください。
あなたはConstraintLayout
Building interfaces with ConstraintLayout
については、この偉大なチュートリアルを読むことができますが、この情報がお役に立てば幸い!
要素に追加した制約を含むXMLを含めてください。制約を追加していない場合は、要素がすべて左上に表示されます。それらを正しく配置するための制約を追加します。 –