目录
2.创建 MotionLayout 文件和MotionScene文件
一、什么是MotionLayout
MotionLayout是ConstraintLayout的子类,是一种可以管理应用中的运动和微件动画的布局类型,它可以帮助安卓开发者关联手势和组件动画。MotionLayout最突破性的一点是它支持在XML中完全描述一个复杂的动画,而不需要通过Java、kotlin等代码来实现。
二、入门使用步骤
1.添加依赖
要在项目中使用MotionLayout,必须在应用的build.gradle文件中添加 ConstraintLayout 2.0 或更新版本的依赖项
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'