没有 Theme.Light.Dialog
可用于我正在使用 Theme.Light
的项目的其余部分.
There is no Theme.Light.Dialog
to use with the rest of my project that is using Theme.Light
.
如何将 Theme.Dialog
更改为类似于 Dialog
的 Theme.Light
版本.
How can I change Theme.Dialog
to look like a Theme.Light
version of Dialog
.
我知道我必须覆盖 style.xml 中的 Theme.Dialog
部分,如下所示.我应该用哪些值覆盖哪些项目?
I know that I must overwrite sections of Theme.Dialog
in styles.xml as below. What items should I overwrite with which values?
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="android:???????"></item>
<item name="android:???????"></item>
</style>
我可以将背景设为浅白色灰色,但按钮、微调器等在浅色主题上也有所不同,以便在浅色背景上看起来更好.
I could just make the background that light white grey, but the buttons, spinners etc are also different on the light theme to look better on the light background.
编辑
看起来我已经成功了.
<color name="black">#FF000000</color>
<color name="whitegrey">#FFF2F2F2</color>
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="@android:windowBackground">@color/whitegrey</item>
<item name="@android:textColor">@color/black</item>
</style>
看来我搞定了.
<color name="black">#FF000000</color>
<color name="whitegrey">#FFF2F2F2</color>
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="@android:windowBackground">@color/whitegrey</item>
<item name="@android:textColor">@color/black</item>
</style>
这篇关于将 Theme.Dialog 更改为 Android 中的 Theme.Light.Dialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!