【发布时间】:2016-10-19 08:59:26
【问题描述】:
当我在约束布局中使用android:layout_height="match_parent" 或android:layout_width="match_parent" 作为子级的高度/宽度并构建Gradle 文件时,它会分别自动更改为android:layout_height="0dp" 或android:layout_widtht="0dp"。
从技术上讲,0dp 和 match_parent 之间存在巨大差异。
大多数时候它不会影响我的布局,但有时这个东西会完全破坏我的约束布局。
我不知道为什么会这样。
请指导我。
【问题讨论】:
-
"0dp" 相当于 ConstraintLayout 中的 "match_parent",在此处阅读更多内容developer.android.com/training/constraint-layout/index.html
标签: android android-layout android-studio android-constraintlayout