android ConstraintLayout不允许负边距

前端之家收集整理的这篇文章主要介绍了android ConstraintLayout不允许负边距前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我相对于布局指南定位了很多项目,
并且希望几乎相对于此布局指南定位新项目.

我尝试使用负布局边距但没有成功.

解决方法

这是一个讨论ConstraintLayout中负边距的 blog posting.

Using Spaces for negative margins

A view in a ConstraintLayout cannot have negative margins (it’s not supported). However,with an easy trick you can have similar functionality by inserting a Space (which is essentially an empty View) and setting its size to the margin you want.

原文链接:https://www.f2er.com/android/312478.html

猜你在找的Android相关文章