問題描述
沒有 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!