1

タイトルとコメントに2つの編集テキストが含まれるダイアログがあります。ホロテーマでこの編集テキストが必要です。誰かがこれを解決するのを手伝ってください。

4

1 に答える 1

2

これを使って:

AlertDialog.Builder builder = new AlertDialog.Builder(new 
ContextThemeWrapper(this, R.style.AlertDialogCustom));

Becoz android は、ContextThemeWrapper を使用してダイアログのスタイルを設定します。

リソースでカスタム スタイルを定義してください。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AlertDialogCustom" parent="@android:style/Theme_Holo_Dialog">
        <item name="android:textColor">#FFFF00</item>
        <item name="android:typeface">monospace</item>
        <item name="android:textSize">18sp</item>
    </style>
</resources>

ここでさらにテーマを取得できます: http://developer.android.com/reference/android/R.style.html

于 2012-10-05T12:08:23.247 に答える