AlertDialog.Builder 样式设置

时间:2022-06-04 04:43:23

AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom)); 
然后自定义自己的样式就可以了
<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="AlertDialogCustom" parent="@android:style/AlertDialog"> 
        <item name="android:textColor">#00FF00</item> 
        <item name="android:typeface">monospace</item> 
        <item name="android:textSize">10sp</item> 
    </style> 
</resources>