约束布局ConstraintLayout的使用你知道吗
16lz
2021-01-23
1.ConstraintLayout设置match_parent后约束失效
原因:官方文档已经说明,ConstraintLayout包裹的控件不支持match_parent取值。
解决:使用match_constraint,但是实际上并没有这个属性,所以一般使用0dp表示match_constraint。
Android官方原文描述:Important: MATCH_PARENT is not supported for widgets contained in a ConstraintLayout, though similar behavior can be defined by using MATCH_CONSTRAINT with the corresponding left/right or top/bottom constraints being set to "parent".
更多相关文章
- Android下拉列表控件spinner-andoid学习之旅(十一)
- Android View之组合控件实例(二)
- Android动态设置控件高度
- 自定义控件5---TypedArray和AttributeSet
- android 自定义商城app价格正序倒序控件
- [转]Android文字跑马灯控件
- android >ToggleButton(开启/关闭) 控件
- android的xml控件遇到的问题(1)