在较旧的Android版本(2.3.3)上更改AlertDialog文本颜色和大小

时间:2013-03-06 09:30:37

标签: android android-alertdialog android-theme

我正在开发小型Android应用程序,我想在其中自定义AlertDialog。为此,我以下列方式为AlertDialog创建了我的样式:

<style name="MyTheme" parent="@android:style/Theme">
    <item name="android:alertDialogStyle">@style/dialog</item>
</style>

<style name="dialog">
    <item name="android:fullDark">@drawable/dialog_title</item>
    <item name="android:topDark">@drawable/dialog_title</item>
    <item name="android:centerDark">@drawable/dialog_body</item>
    <item name="android:bottomDark">@drawable/dialog_footer</item>
    <item name="android:fullBright">@drawable/dialog_body</item>
    <item name="android:centerBright">@drawable/dialog_body</item>
    <item name="android:bottomBright">@drawable/dialog_footer</item>
    <item name="android:bottomMedium">@drawable/dialog_footer</item>
    <item name="android:centerMedium">@drawable/dialog_body</item>
</style>

我正在通过以下方式将此主题应用于AlertDialog

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

但我无法在旧版Android(2.3.3)上更改标题标题文字颜色及其大小。怎么做?

0 个答案:

没有答案