ConstraintLayout布局中使用include引用布局,约束属性不起作用

问题:使用约束布局时,再使用include引用布局,造成约束的一些属性没有起作用。

解决方案:重写 android:layout_width、android:layout_height 这两个属性。

例如:

<include
        layout="@layout/layout_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent" />

猜你喜欢

转载自blog.csdn.net/qq_40166103/article/details/115317990
今日推荐