我想使用新的Android 12 API来创建启动画面,但如果我在主题中使用我的
drawable
图标作为参数windowSplashScreenAnimatedIcon
,它会被拉伸。我该如何调整该图标的大小?
我的图标不是矢量图。我必须使用PNG文件。drawable
图标作为参数windowSplashScreenAnimatedIcon
,它会被拉伸。我该如何调整该图标的大小?
我的图标不是矢量图。我必须使用PNG文件。<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>
<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>