gpt4 book ai didi

android - AndroidX 中的 MotionLayout

转载 作者:太空狗 更新时间:2023-10-29 14:36:26 27 4
gpt4 key购买 nike

我想使用 MotionLayout 但我的应用程序在 AndroidX 中,我尝试使用通常的 XML 标签,但它们不起作用。布局编辑器只显示一个带有标签名称的灰色框。我如何在 AndroidX 中使用 MotionLayout,或者如果这不可能,你能给我一个替代方案吗。

谢谢:)

现在 GridLayout 也发生了。以下是屏幕截图:

enter image description here enter image description here

这很奇怪。GridLayout 的代码:

<androidx.gridlayout.widget.GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content>

</androidx.gridlayout.widget.GridLayout>

最佳答案

MotionLayout 已添加到 ConstraintLayout 2.0,因此请确保您拥有

实现 'androidx.constraintlayout:constraintlayout:$androidConstraintLayoutVersion'

在您应用的 build.gradle 中,其中 $androidConstraintLayoutVersion 至少为 2.0

关于android - AndroidX 中的 MotionLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54537566/

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