LoginSignup
1
3

More than 3 years have passed since last update.

【Kotlin 初心者】スプラッシュ画面の作り方

Last updated at Posted at 2021-03-17

Kotliでスプラッシュ画面の作り方について

そもそもスプラッシュとは?
アプリの立ち上げる刹那に表示される画像のことです

イメージ

こちらのスプラッシュは私が作ったLupriというアプリのスプラッシュになります。
実装は非常に簡単です

実装方法


        <activity android:name="MainActivity"
            // themeを追加する
            android:theme="@style/AppTheme.Splash">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
<resources>
    <style name="AppTheme.Splash" parent="Theme.AppCompat.DayNight.NoActionBar">
        // あらかじめdrawableに表示するスプラッシュ画像を用意する
        <item name="android:windowBackground">@drawable/splash</item>
    </style>
</resources>

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3