0

AlertDialogの背景とテキストの色を変更しようとして います。 ただし、アクティビティ でタイトルの色のみを変更できます。
android:windowTitleStyle


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

スタイル.xml

style name="AlertDialogCustom" parent="Holo.Theme.Sherlock"


どうやってやるの?ありがとう。

4

3 に答える 3

3
adb.setMessage(Html.fromHtml("<font color='#FF0000'><b>John:</b></font>"+"How are you?"))

これはテキストの色を変更するためのものです。独自のダイアログ ボックスを作成できます。このリンクをチェックしてください http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application

http://developer.android.com/guide/topics/ui/dialogs.html

于 2012-10-17T16:29:33.697 に答える
0

これを試して:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<style name="AlertDialogCustom" parent="@android:style/AlertDialog"> 
    <item name="android:textColor">#00FF00</item> 
    <item name="android:background">#0000FF</item>
    <item name="android:typeface">monospace</item> 
    <item name="android:textSize">10sp</item> 
</style> 
</resources>
于 2012-10-17T16:29:21.957 に答える