Android 12闪屏图标

46scxncf  于 2023-06-28  发布在  Android
关注(0)|答案(2)|浏览(177)

我想使用新的Android 12 API的闪屏,但如果我使用我的drawable图标内的主题参数windowSplashScreenAnimatedIcon,其拉伸.如何调整图标的大小?我的图标不是矢量。我必须使用PNG文件。

6uxekuva

6uxekuva1#

很可能,您必须遵循闪屏尺寸。谷歌说:

  • 带有图标背景的应用程序图标:这应该是240×240 dp,并且适合直径为160 dp的圆。
  • 没有图标背景的应用程序图标:这应该是288×288 dp,并且适合直径为192 dp的圆。

mum43rcc

mum43rcc2#

创建2值目录
在值中-v31

<style name="SplashScreenTheme" parent="Theme.SplashScreen">
    <item name="android:windowSplashScreenBackground">@color/color_121326
    </item>
    <item name="postSplashScreenTheme">@style/SplashScreen</item>
    <item name="android:windowSplashScreenAnimatedIcon">
        @drawable/ic_splash_center
    </item>
    <item name="splashScreenIconSize">@dimen/dp_100</item>
</style>

和值-v33

<style name="SplashScreenTheme" parent="Theme.SplashScreen">
    <item name="android:windowSplashScreenBackground">@color/color_121326
    </item>
    <item name="postSplashScreenTheme">@style/SplashScreen</item>
    <item name="android:windowSplashScreenAnimatedIcon">
        @drawable/drawable_splash
    </item>
    <item name="splashScreenIconSize">@dimen/dp_100</item>
</style>

在可画的飞溅中

<item
    android:width="@dimen/dp_100"
    android:height="@dimen/dp_100"
    android:gravity="center">
    <bitmap android:src="@drawable/ic_splash_center" />
</item>

我发现它的作品调整图标以上api 33

相关问题