Change Theme.Dialog to look like Theme.Light.Dialog in Android(将 Theme.Dialog 更改为 Android 中的 Theme.Light.Dialog)
问题描述
没有 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 Theme.Dialog 更改为 Android 中的 Theme.Light.Dialog


- android 4中的android RadioButton问题 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01