ConstraintLayout の基本的な考え方

<android.support.design.button.MaterialButton
    android:id="@+id/button1"

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="1"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toTopOf="@id/button2" 
/>

layout_constraintBottom_toTopOf=”@id/button2″ は

@+id/button1 の constraintBottom を @id/button2 の toTop に合わせる

 

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha