【发布时间】:2020-09-27 09:23:54
【问题描述】:
【问题讨论】:
标签: android animation transition
【问题讨论】:
标签: android animation transition
你有多项选择:
您可以使用此库进行两种类型的转换
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)。在这种情况下,您可以在paren 上设置beginDelayTransition,所有直接子级将在布局属性更改时设置动画。更多信息请阅读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。欲了解更多信息,请阅读链接。viewPager。您可以创建两个片段第一个使用键盘输入价格,第二个输入“for”,其余视图保留在父级中。然后在标题中点击价格的这两个片段之间切换viewPager,您还需要根据当前片段淡入/淡出标题价格和“取消”按钮。您将看到类似您的 gif 的内容。【讨论】:
你可以试试Motion Editor
如需更深入的研究,请尝试 Youtube 上的一些视频教程。
【讨论】: