有没有办法以编程方式更改应用程序启动动画? 每当我启动应用程序时,它的动画就像来自屏幕底部,但我希望它来自屏幕顶部。
感谢任何帮助。
最佳答案
您可以简单地使用 AlphaAnimation ,并将其应用到 Activity 的布局,如下所示,在 onCreate() 方法中:
super.onCreate(savedInstace);
this.setContentView(R.layout.main);
RelativeLayout layout = findViewById(R.id.idLayout);
AlphaAnimation animation = new AlphaAnimation(0.0f , 1.0f ) ;
animation.setFillAfter(true);
animation.setDuration(1200);
//apply the animation ( fade In or whatever you want) to your LAyout
layout.startAnimation(animation);
关于java - 如何更改应用程序的启动动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48210764/