gpt4 book ai didi

android - 我怎样才能改变android :windowBackground?

转载 作者:太空宇宙 更新时间:2023-11-03 11:04:53 25 4
gpt4 key购买 nike

所以我正在尝试为我的 Android 应用程序使用统一的自定义主题,这个想法是在应用程序加载时(在统一 Logo 之前)更改颜色(甚至添加图像),因为一些低端设备最多需要 10 秒才能显示启动画面,而 10 秒的黑屏只会让人觉得应用程序已损坏。

到目前为止,我的 android list 有:

android:theme="@style/CustomTheme"

我有另一个文件的样式:

<resources>
<style name="CustomTheme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
<item name="android:windowBackground">@drawable/editor_bg</item>
</style>
</resources>

每当我更改样式的父项时,对 Theme.Translucent.NoTitleBar 说,我会看到更改,我的应用会删除黑屏,因此我知道样式已更改/使用。

我的问题是@drawable/editor_bg 似乎根本不起作用,我什至尝试使用颜色而不是带有@color/white 的图像,在另一个文件中定义。

不确定是 unity 本身的问题(使用 5.3.1 个人版)还是 android 端缺少某些东西。感谢您的帮助。

最佳答案

试试这个:

<resources> 
<style name="CustomTheme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
<item name="android:windowBackground">@drawable/editor_bg</item>
<item name="?windowBackground">@drawable/editor_bg</item>
</style>
</resources>

关于android - 我怎样才能改变android :windowBackground?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34903810/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com