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".

更多相关文章

  1. Android下拉列表控件spinner-andoid学习之旅(十一)
  2. Android View之组合控件实例(二)
  3. Android动态设置控件高度
  4. 自定义控件5---TypedArray和AttributeSet
  5. android 自定义商城app价格正序倒序控件
  6. [转]Android文字跑马灯控件
  7. android >ToggleButton(开启/关闭) 控件
  8. android的xml控件遇到的问题(1)

随机推荐

  1. 如何从VS2015中实现Mono框架?
  2. QNX与Linux两家未来有望独霸车载电子操作
  3. linux编程之国际化和本地化
  4. linux使用技巧,返回上一次目录
  5. Linux下获得本机IP(非127.0.0.1)
  6. linux常用命令大全(转)
  7. Linux C Socket UDP编程介绍及实例
  8. Linux学习第二天-文件系统和简单文件操作
  9. Linux下高频命令分类辑录(基本使用篇)
  10. linux从入门到精通(八)(添加用户)