Android 安卓工作室可以';找不到MotionLayout的类
我正在尝试使用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
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