如何在安卓中从启动画面过渡到主界面的动画?

huangapple go评论75阅读模式
英文:

How to animate from splash screen to main screen on Android?

问题

我在这里的建议链接中,按照步骤设置了将闪屏界面定义为可绘制项,并将其设置为启动活动的主题。然而,正如预期的那样,转换有点突然。有人能否提供一种在转换过程中添加动画的方法?

英文:

I followed the advice here to setup my splash screen to be defined as a drawable and set as the theme for the launching Activity. However as expected the transition is a bit abrupt. Could someone suggest a way to animate the transition?

答案1

得分: 1

你所阅读的建议是创建启动屏幕的一个非常好的方法,因为我们避免了应用初始化时出现空白屏幕。

要创建活动/片段过渡,我认为除了创建SplashActivity/SplashFragment并在一定延迟后或在必要时加载数据后开始过渡之外,没有其他方法。

然而,我尚未将这两种方法结合起来,即在更改主题并在之后运行过渡。也许有一种方法可以将这两种方法结合起来,这样我们就可以找到一个最佳平衡点,即应用启动时没有空白屏幕,并且我们有过渡效果。

英文:

The advice you've read is a very good way for creating splash screen, because we're avoiding blank screen on app initialization.

To create the activity/fragment transition I think there is no other way than creating a SplashActivity/SplashFragment and starting the transition after some delay or when necessary data is loaded.

However I haven't combined those two approaches together, so changing the theme and running the transition after. Maybe there is a way to combine those two, so we can end up with sweet spot, where we don't have blank screen on app start + we have transition.

答案2

得分: 1

使用通过动画启动活动(官方文档)或者Material Design中的动画效果

英文:

Try with Start an activity using an animation (Offical Document) or The Motion in Material Design

huangapple
  • 本文由 发表于 2020年9月30日 16:03:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/64133358.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定