Android AlertDialog标题和背景色的设置

用过AlertDialog的童鞋应该都很清楚,当我们新建一个AlertDialog的时候,它的背景色和标题都是固定样式的,有的时候跟你设计的AP风格可能不是很搭配,在这种情况下,如果我们想改变一下,可以通过下面的方式:

1、更改AlertDialog的背景色

     AlertDialog.Builder settingDialog = new AlertDialog.Builder(mContext);
     settingDialog.setInverseBackgroundForced(true);

2、更改AlertDialog title的样式

TextView title = new TextView();

title.setText("Android");

settingDialog.setCustomTitle(title);

 

原文地址:https://www.cnblogs.com/yaowukonga/p/2508743.html