您可以尝试Motion Editor
要进行更深入的研究,请尝试在YouTube上观看一些视频教程。
您有多种选择:
您可以使用此库进行两种类型的转换
TransitionManager
。在这种情况下,您应该创建两个TransitionManager.go()
并在这两个场景之间切换。 所有必需的动画将由过渡管理器处理。有关更多信息,请阅读scene
链接示例:
this
Scene aScene;
Scene anotherScene;
// Create the scene root for the scenes in this app
sceneRoot = (ViewGroup) findViewById(R.id.scene_root);
// Create the scenes
aScene = Scene.getSceneForLayout(sceneRoot, R.layout.a_scene, this);
anotherScene =
Scene.getSceneForLayout(sceneRoot, R.layout.another_scene, this);
//transition from root scene to another scene
TransitionManager.go(anotherScene);
。在这种情况下,您可以在TransitionManager.beginDelayedTransition(rootView)
上设置beginDelayTransition,并且所有直接子对象都将在布局属性更改时进行动画处理。有关更多信息,请阅读paren
链接示例:
this
// Get the root view and create a transition
rootView = (ViewGroup) findViewById(R.id.mainLayout);
mFade = new Fade(Fade.IN);
// Start recording changes to the view hierarchy
TransitionManager.beginDelayedTransition(rootView, mFade);
// change in one of rootView childs
childView.setWidth(100);
// When the system redraws the screen to show this update,
// the framework will animate the addition as a fade in
。有关更多信息,请阅读链接。MotionLayout
。您可以创建两个片段首先使用键盘输入价格,然后创建第二个输入“ for”,其余视图保留在父级中。然后在标题的点击价格的这两个片段之间切换MotionLayout
,也需要淡入/淡出标题价格和基于当前片段的“取消”按钮。您会看到类似gif的内容。