Android主题设置启动页图标大小:splashScreenIconSize
要在Theme中设置splashScreenIconSize,可以按照以下步骤进行操作:
- 首先,在res/values文件夹中创建一个新的styles.xml文件,如果已存在,则打开该文件。
- 在styles.xml文件中,创建一个新的style元素,用于设置splash screen的样式。示例如下:
- 在AndroidManifest.xml文件中,将应用的主题设置为刚刚创建的AppTheme。示例如下:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:splashScreenIconSize">48dp</item>
</style>
这里设置了windowBackground为一个drawable资源文件,同时设置了splashScreenIconSize为48dp。
<application
android:theme="@style/AppTheme">
...
</application>
这样就可以通过设置splashScreenIconSize来改变splash screen的图标大小了。
原文地址: https://www.cveoy.top/t/topic/qyfT 著作权归作者所有。请勿转载和采集!