我有一个通过单击网页中的链接启动的应用程序。
没问题,效果很好。
然而,应用程序主屏幕有点远离浏览器。我想添加一些动画。也许它可以淡入或其他什么。我已经在 ImageView 上完成了补间动画,但不知道如何在整个布局屏幕上执行此操作。有任何想法吗?
我认为您可以简单地使用 AlphaAnimation ,并将其应用到您的 Activity 的布局中,如下所示,在 onCreate 方法中:
super.onCreate(savedInstace);
this.setContentView(R.layout.main);
LinearLayout layout = (LinearLayout) findViewById(R.id.idLayout);
AlphaAnimation animation = new AlphaAnimation(0.0f , 1.0f ) ;
animation.setFillAfter(true);
animation.setDuration(1200);
//apply the animation ( fade In ) to your LAyout
layout.startAnimation(animation);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)