2

I have created a simple custom theme for my dialog boxes, but now the EditText elements inside the Dialogs that use this theme do not keep the nice default ICS theme.

Here is the theme I am using:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DarkDialog" parent="@android:style/Theme.Dialog">
    <item name="android:windowFrame">@null</item>
    <item name="android:windowTitleStyle">@style/DarkDialogTitle</item>
    <item name="android:background">#282828</item>
</style>
<style name="DarkDialogTitle">
    <item name="android:textColor">#33B5E5</item>
    <item name="android:paddingLeft">16dip</item>
    <item name="android:paddingRight">16dip</item>
     <item name="android:textSize">22sp</item>
</style>

And this is what I see when I use it:

enter image description here

Is there a way to make the EditText elements inside my custom themed Dialogs use the default theme for whatever device they are on?

4

2 に答える 2

4

制御するAPIレベルごとにテーマが必要になります。

11未満のAPI値の場合、スタイルは@android:style/Theme

11から13の間@android:style/Theme.Holo

14歳以上の場合@android:style/Theme.DeviceDefault

于 2012-04-24T12:02:36.117 に答える
1

Holoダイアログテーマから派生する必要があると思います。

<style name="DarkDialog" parent="@android:style/Theme.Holo.Dialog">
于 2012-04-24T12:02:40.510 に答える