Androidスプラッシュ画面の例
May 5, 2020
Uncategorized

このとうこうでは、Androidスプラッシュ画面の例を紹介します.スプラッシュ画面は、アプリを起動したときに表示される画面です。スプラッシュ画面は非常に一般的な用語であり、すべてのアプリケーションに必要です.
方法
- さくせいされたアクティビティ
- せっけいスプラッシュスクリーン
スプラッシュテーマの作成
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <!-- Android Splash Screen Example --> <style name="AppTheme.Launcher" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowBackground">@drawable/splash_screen</item> </style> </resources>
スプラッシュスクリーンの表示
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.Launcher">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Androidコード