Application设置Theme背景图后打开APP还是闪白屏

雕·不懒惰 2018-09-19 05:13:50
<application
android:name=".WallPaperApplilcation"
android:allowBackup="true"
android:icon="@mipmap/wallpaper"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".main.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@mipmap/load_wall</item>这里设置背景图片
</style>

在启动应用的时候显示的是设置的背景图片,过几秒后进入MainActivity为什么还是会闪白屏,MainActivity设置一样的Theme也还是会闪白屏,求解
...全文
370 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
雕·不懒惰 2018-09-20
  • 打赏
  • 举报
回复
引用 1 楼 qq_28977953 的回复:
<style name="AppTheme.Launcher" parent="Theme.AppCompat.Light.NoActionBar">
<!-- 通过windowBackground可以设置背景色、背景图片、能解析出图片的XML文件等-->
<item name="android:windowBackground">@drawable/layer_launcher</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>

需要在MainActivity下设置theme


MainActivity设置了还是一样
qq_28977953 2018-09-20
  • 打赏
  • 举报
回复
<style name="AppTheme.Launcher" parent="Theme.AppCompat.Light.NoActionBar">
<!-- 通过windowBackground可以设置背景色、背景图片、能解析出图片的XML文件等-->
<item name="android:windowBackground">@drawable/layer_launcher</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>

需要在MainActivity下设置theme

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧