ConstraintLayout stretches outside the screen

原文链接
wrap_content只会测量自己,不受最终约束的限制
match_constraints(0dp)将根据约束限制小部件的大小,但如果wrap_content比约束还小也不适用

更好的View尺寸控制

width = 0dp
layout_constraintWidth_default = spread

ps:在1.1.0 beta 2中可以使用

app:layout_constrainedWidth=”true|false”
app:layout_constrainedHeight=”true|false”
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容