Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓工作室可以';找不到MotionLayout的类_Android_Android Studio_Android Layout_Android Motionlayout - Fatal编程技术网

Android 安卓工作室可以';找不到MotionLayout的类

Android 安卓工作室可以';找不到MotionLayout的类,android,android-studio,android-layout,android-motionlayout,Android,Android Studio,Android Layout,Android Motionlayout,我正在尝试使用android MotionLayout,但它找不到适合它的类,因此无法工作 我尝试实现以下依赖项: implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1' implementation 'com.android.support.constraint:c

我正在尝试使用android MotionLayout,但它找不到适合它的类,因此无法工作

我尝试实现以下依赖项:

implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha4'
但它们似乎都不起作用

这是我的XML文件:

<android.support.constraint.motion.MotionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
footstools="http://schemas.android.com/tools"
android:id="@+id/motionLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showPaths="true"
tools:context=".PlayGameActivity">

<View
    android:id="@+id/button"
    android:layout_width="64dp"
    android:layout_height="64dp"
    android:background="@color/colorAccent"
    android:text="Button" />

</android.support.constraint.motion.MotionLayout >'
在项目的预览窗口中,它以灰色填充整个布局,并在中心写入:

android...MotionLayout

没有
android.support.constraint.motion.MotionLayout

实现中“androidx.constraintlayout:constraintlayout:2.0.0-beta2”

它被称为
androidx.constraintlayout.motion.widget.MotionLayout

如果
MotionLayout
显示为灰色,则可能缺少
app:layoutDescription
XML


AndroidX&Support Library版本有一个问题。

感谢您的回答,但仍然存在相同的问题(加上我尝试了您提供的链接中的所有内容),但不幸的是,似乎没有任何东西对我有效。
android...MotionLayout