Android add other layout in ConstraintLayout using include tag

Android include tag does work with ConstraintLayout, but you need to declare how big is the layout you want to include with the following attributes.

<include
     layout="@layout/content_main"
     android:layout_width="100dp"
     android:layout_height="250dp"
     .../>

For included layout having dynamic height use wrap_content as a value in layout_height or layout_width attributes of include tag.

<include
    android:id="@+id/input_include"
    layout="@layout/task_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

After that, your constraints should work.

Leave a Comment

deneme bonusudeneme bonusu veren sitelerOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino