1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

includeしたレイアウトに対してConstraintLayoutの制約を適応する方法

Posted at

今回は知らない方がいたので、ConstraintLayoutを使用している時に共通のレイアウトなどをincludeして表示する際にConstraintLayoutの制約を適応する方法を残しておこうと思います。

includeしたレイアウトに対してConstraintLayoutの制約の適応方法

 <include
        android:id="@+id/include_view"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        layout="@layout/include_view" />

android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_widthとandroid:layout_heightをincludeの設定に追加すると制約が効くようになります!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?