为保证风格统一,项目要求APP的背景统一使用桌面背景、不要title:
<style name="MyTheme" parent="AppTheme">
<!--no title-->
<item name="windowActionBar">true</item>
<item name="windowNoTitle">true</item>
<!--background 透明,这里是自定义了一个color-->
<item name="android:windowBackground">@color/transparent</item>
<!--设置显示wallpaper,否则会显示出launcher的图标-->
<item name="android:windowShowWallpaper">true</item>
</style>
在Application中使用该theme,其activity默认使用application的theme,方然也可以另外设置;
需要注意设置parent,否则会报错:
You need to use a Theme.AppCompat theme (or descendant) with this activity.