Joh*_*aul 1 android android-constraintlayout android-motionlayout
我正在使用 ConstraintLayout 2.0 来做一些 MotionLayout 动画。我从更新了我的ConstraintLayout 2.0alpha-3到beta-3现在编制,它的投诉时
src/main/res/xml/scene.xml:11: AAPT: 错误: 属性目标(又名 com.myapp:target)未找到。
我没有更改 MotionLayout 场景文件中的任何内容。以下是违规部分:
<MotionScene
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:motion="http://schemas.android.com/apk/res-auto">
...
<Transition
motion:constraintSetStart="@+id/start"
motion:constraintSetEnd="@+id/end"
motion:duration="1000">
<KeyFrameSet>
<KeyPosition
motion:target="@+id/accent_background" <<-- Here
motion:framePosition="80"
motion:percentX="1"
motion:percentY="1" />
Run Code Online (Sandbox Code Playgroud)
我查看了 MotionLayout 的文档,对我来说这并没有改变,但目标仍然是这样定义的。或者我错过了什么?
我确实清除了缓存并尝试重建,但没有帮助。
解决了。
该属性已重命名为motionTarget。所以定义应该是
<KeyFrameSet>
<KeyPosition
motion:motionTarget="@+id/accent_background"
motion:framePosition="80"
motion:percentX="1"
motion:percentY="1" />
Run Code Online (Sandbox Code Playgroud)
Google 的 MotionLayout 博客文章 ( https://medium.com/google-developers/introduction-to-motionlayout-part-i-29208674b10d ) 具有旧的属性名称,但文档已更新它们 ( https://developer.android .com/reference/android/support/constraint/motion/MotionLayout#keyposition )
| 归档时间: |
|
| 查看次数: |
833 次 |
| 最近记录: |