android - MotionLayout 和约束组

标签 android android-motionlayout

我要开始使用 MotionLayout
用 MotionLayout 替换现有的 ConstraintLayout 后, 其中有一个简单的运动场景,
我注意到 androidx.constraintlayout.widget.Group 不再工作了。
最初,我根据条件显示了两组中的一组,
但现在它们都可见,即使我将可见性设置为 GONE
我能否以某种方式让 MotionLayout 与组一起工作,或者我应该使用不同的 MotionLayouts?

最佳答案

ConstraintLayout 的最新版本是 2.0.0-beta2,并验证了 MotionScene 不关心 androidx.constraintlayout.motion.widget.Group。因此,如果您想更改可见性或高程值,您应该为每个 View 单独处理它,而不是应用于虚拟组。

关于android - MotionLayout 和约束组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56790321/

相关文章:

android - 是否可以禁用 MotionLayout?

android - 在代码中添加排序时排序列表忽略 0

android - Gradle 卡在执行任务 : [:android:generateDebugSources

访问 sim 工具包的 android 应用程序

android - MotionLayout - 日志中恼人的调试错误 : "no widget for <view id> (<view type>)"

android - ScrollView内部的MotionLayout在状态改变后不更新高度

android - MotionLayout 忽略填充

java - Android开发-OnTouchListener-如何使用?

java - 无法使用文件提供程序共享图像 java.lang.SecurityException : Permission Denial: reading androidx. core.content.FileProvider uri

android - MotionLayout没有动画