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之使用串口通信及协议解析
  2. Android中Gzip使用
  3. Android中使用Streams的两种方法
  4. Android(安卓)Java执行Shell命令
  5. 史上最详细的Android(安卓)Studio系列教程三--快捷键
  6. android 开发 时间选择器TimePicker的使用
  7. 箭头函数的基础使用
  8. NPM 和webpack 的基础使用
  9. Python list sort方法的具体使用

随机推荐

  1. Jenkins长大了,Pipeline该用起来了!
  2. HTML5 蓝色 3D 钻石旋转动画
  3. Javascript 性能测试 [每日前端夜话0xB1]
  4. 漂亮实用!一款基于Bootstrap的jQuery开关
  5. 用 NodeJS 重命名系统文件[每日前端夜话0
  6. 什么?你项目还在用Date表示时间?!
  7. CSS3 全屏大气手风琴图片展示插件
  8. 嗯,用了一下Kotlin编程语言,真香!
  9. 纯CSS3骏马奔腾动画特效
  10. 用 Jest 进行 JavaScript 测试[每日前端