当前位置:   article > 正文

你不知道的ConstraintLayout高级用法_constraintlayout flow

constraintlayout flow

1. ConstraintLayout介绍

ConstraintLayout,约束布局。我们都知道 ConstraintLayout 是继传统三大布局容器(LinearLayout、RelativeLayout、FrameLayout)之后,谷歌又推出的一种扁平化布局容器。相比传统三大布局容器,它有着扁平化、灵活约束等特点。

2. 高级用法

2.1 Gone Margin

我们知道View之间的间距用 layout_margin 来定义,但是 ConstraintLayout 除了layout_margin,还有
layout_goneMargin。
从名字可以大概猜出,layout_goneMargin 的作用是: 当目标View隐藏(Gone)之后,该 margin 才会生效。
具体的属性有:

layout_goneMarginStart
layout_goneMarginEnd
layout_goneMarginLeft
layout_goneMarginTop
layout_goneMarginRight
layout_goneMarginBottom
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

有什么实际用途呢?举个例子

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/816418
推荐阅读
相关标签