Android的:先从动画应用程序应用程序、动画、Android

2023-09-06 19:07:22 作者:恶人总是我

我有一个通过点击网页中的链接启动一个应用程序。

I have an app that is launched by clicking a link in a webpage.

没有问题,工作正常。

No problem, that works fine.

不过,应用主屏只是有点颠簸而去浏览器。我想补充一点的动画。也许它可以淡入或东西。我已经做了ImageView的补间动画,但不知道如何做到这一点的完整布局屏幕。任何想法?

However, the app main screen just sort of bumps away the browser. I'd like to add a little animation. Maybe it can fade-in or something. I have done tween animations on ImageView but not sure how to do it for the full layout screen. Any ideas?

推荐答案

我想你可以简单地使用AlphaAnimation,并将其应用到你的活动这样的布局,在onCreate方法:

i think you can simply use the AlphaAnimation , and apply it to the layout of your Activity like this , in the onCreate method :

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);