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

标签 android android-constraintlayout constraint-layout-chains

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

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

3 是极限吗?

我尝试添加第四个元素,但它没有按照概念链接。 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/

相关文章:

android - 如何通过代码在Android中检索调用转移状态?

android - ConstraintLayout 截断 TextView 中过长的文本

Android 布局与设备不匹配 [Android Studio]

Android约束布局: resize images for all resolutions

android - 具有固定纵横比的 ConstraintLayout 链

android - 应用程序崩溃,出现错误 : The String#value field is not present on Android versions >= 6. 0

android - 在没有 bundletool 的情况下从命令行使用动态功能模块构建 apk

java - SQLite 异常 : no such column in Android

java - 如何修改约束布局中的链长?

android - 如何在约束布局上实现重叠/负边距?