1.主Activity布局中添加:
<LinearLayout android:orientation="vertical" android:id="@+id/ll_come" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@mipmap/come" android:visibility="invisible"> </LinearLayout>2.主Activity中添加代码:
private LinearLayout ll_come;...
AlphaAnimation animation = new AlphaAnimation(1.0f,1.0f); animation.setDuration(2000); ll_come = (LinearLayout) findViewById(R.id.ll_come); ll_come.setAnimation(animation); animation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { ll_come.setVisibility(View.VISIBLE); } @Override public void onAnimationEnd(Animation animation) { ll_come.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { ll_come.setVisibility(View.GONE); } });
2520

被折叠的 条评论
为什么被折叠?



