我试图根据单击的按钮在不同的位置显示一个 View 。
但是当我在其中使用两个时,MotionScene无法正常工作。

<MotionScene xmlns:motion="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
>

<Transition android:id="@+id/toTimePicker2"
motion:duration="500" motion:constraintSetStart="@layout/add_event_fragment"
 motion:constraintSetEnd="@id/enableTimePicker2">
<OnClick motion:target="@+id/time_to" motion:mode="toggle"/>
</Transition>

<Transition android:id="@+id/toTimePicker1"
motion:constraintSetStart="@layout/add_event_fragment"
motion:constraintSetEnd="@id/enableTimePicker1"
motion:duration="500">
<OnClick motion:target="@+id/time_from"
  motion:mode="toggle" />
 < /Transition >

有谁知道如何通过运动布局实现它?
看起来我应该在代码中使用ConstraintSet,但是我只想知道Motion是否可以实现

最佳答案

刚从昨天开始观看Android开发峰会。.Alpha 3将支持“运动布局状态”。

Check this video整个视频值得一看,但视频中提到的“运动布局”状态是36:50,因为他们提到了ConstraintLayout Alpha 3。

关于android - 可以使用具有不同过渡的运动布局吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52971516/

10-11 02:59