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);
2条答案
按热度按时间55ooxyrt1#
您可以简单地使用AlphaAnimation,并在**onCreate()**方法中将其应用到Activity的布局中,如下所示:
lstz6jyr2#
你可以试试这个
top_down.xml在anim文件夹中
和/或
down_top.xml在anim文件夹中
并应用于此。