gpt4 book ai didi

android - ConstraintLayout 中可以链接多少个 View (添加关系)

转载 作者:行者123 更新时间:2023-11-29 16:30:45 25 4
gpt4 key购买 nike

Android 中的约束布局支持 View 链(https://developer.android.com/reference/android/support/constraint/ConstraintLayout#chain-style)

我检查了几个例子,到处只展示了 3 个 View 来展示这个概念。

3 是极限吗?

我尝试添加第 4 个元素,但它没有按照概念链接。 Chaining with 3 Elements

包含 3 个元素的链接

Chaining with 4 elements

链接 4 个元素

代码 - https://gist.github.com/vamsigp/784be59f8ae1e2137ece1349c726d1f8

最佳答案

您的布局有误:

app:layout_constraintRight_toRightOf="share2"

应该是:

app:layout_constraintRight_toLeftOf="@+id/share2"

关于android - ConstraintLayout 中可以链接多少个 View (添加关系),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55904807/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com