我正在开发小型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)上更改标题标题文字颜色及其大小。怎么做?