これは、xmlレイアウトを1つだけ使用して行いました。私はちょうどそれに私のイントロ画面を表す追加のRelativeLayoutを入れ、次にそれにfadeOut Animationを使い、.setVisibility(View.GONE)を呼び出します。
これは
<RelativeLayout
android:id="@+id/introLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
>
<ImageView
android:id="@+id/logoImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/logo">
</ImageView>
</RelativeLayout>
その後、私のmain.xmlレイアウトファイルの一部であり、私の活動の内側に私はこれがあります)あなたはstartAnimationを入れて3秒後に、この実行を作ることができる
introLayout = (RelativeLayout) findViewById(R.id.introLayout);
Animation fadeOutAnim = AnimationUtils.loadAnimation(MyActivity.this, R.anim.fadeout);
introLayout.startAnimation(fadeOutAnim);
introLayout.setVisibility(View.GONE);
を( 、実行可能ファイルの中のsetVisibility、および前述のmarkusとしてのpostDelayed()の使用。このイントロのレイアウトが画面に表示されている間に作業を行うことを検討してください。そのため、ユーザーの3秒間の遅延だけではありません。アプリケーションの実行中のバージョンが現在のバージョンであるかどうかを確認してください。
EDIT: あなたは(それが存在しない場合はアニメーションのディレクトリを作成します)/res/anim/
にfadout.xmlファイルを追加する必要があります。ここに例があります。
fadeout.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="700"
android:fillAfter="true"/>
これはスマートな解決策です! – Sana
'R.anim.'の' .anim.'はどこに行きますか? 'animは解決できないか、フィールドではない' – Alex
@ w0rldart fadeout.xmlを '/ res/anim /'フォルダに追加する必要があります。私の編集を参照してください。 – FoamyGuy