更改Theme.Dialog看起来像Theme.Light.Dialog Android中 [英] Change Theme.Dialog to look like Theme.Light.Dialog in Android

查看:252
本文介绍了更改Theme.Dialog看起来像Theme.Light.Dialog Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有 Theme.Light.Dialog 与我的项目中正在使用的其余部分使用 Theme.Light

如何修改 Theme.Dialog 看起来像一个 Theme.Light 版本对话。

我知道我必须覆盖styles.xml Theme.Dialog 的部分如下。我应该覆盖与价值观是什么项目?

 <样式名称=dialog_light父=@安卓风格/ Theme.Dialog>
    <项目名称=机器人:???????>< /项目>
    <项目名称=机器人:???????>< /项目>
< /风格>
 

我可以只让背景光白灰色,但按钮,纺织等也都对光线的主题更好看在浅色背景不同。

修改

看起来像我得到它的工作。

 <颜色名称=黑>#FF000000< /彩色>
<颜色名称=whitegrey>#FFF2F2F2< /彩色>

<样式名称=dialog_light父=@安卓风格/ Theme.Dialog>
    <项目名称=@安卓windowBackground> @色/ whitegrey< /项目>
    <项目名称=@机器人:文字颜色> @彩色/黑白LT; /项目>
< /风格>
 

解决方案

看起来像我得到它的工作。

 <颜色名称=黑>#FF000000< /彩色>
<颜色名称=whitegrey>#FFF2F2F2< /彩色>

<样式名称=dialog_light父=@安卓风格/ Theme.Dialog>
    <项目名称=@安卓windowBackground> @色/ whitegrey< /项目>
    <项目名称=@机器人:文字颜色> @彩色/黑白LT; /项目>
< /风格>
 

There is no Theme.Light.Dialog to use with the rest of my project that is using Theme.Light.

How can I change Theme.Dialog to look like a Theme.Light version of 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.

EDIT

Looks like I got it working.

<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>

解决方案

Looks like I got it working.

<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看起来像Theme.Light.Dialog Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆