at the moment I'm trying to nest two Constraint Layouts in each other. For that I use the <include/> tag. What I see there is that the inner Constraint Layout ignores every constraints from the outer Constraint Layout. For making that more visible I draw a border around the inner Constraint Layout:

For trying that stuff I use the com.android.support.constraint:constraint-layout:1.0.0-alpha3.
My Question is now: did I do something wrong or is it even a bug from the alpha version?
In order to add attributes to an included layout using the <include/> tag, you must specify BOTH width and height in the tag itself overriding or simply confirming those of the root tag of the included layout.
Example:
<include
layout="@layout/item_place_custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
this results in the included layout being constrained to the bottom of its parent layout as expected.
This is not exclusive to the newer ConstraintLayout, this is the expected behavior of the <include/> tag as mentioned here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With