相反的变化,你可以创建自己的对话框的主题。这可能比找到纠正DialogTitle的特定样式更简单。
public Dialog createDialogShowMyOrder(String title, String message){
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View inflator = inflater.inflate(R.layout.YOUR_XML_FILE, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
TextView tit = (TextView)inflator.findViewById(R.id.TITLE_IN_XML);
TextView mes = (TextView)inflator.findViewById(R.id.MESSAGE_IN_XML);
tit.setText(title);
mes.setText(message);
builder.setView(inflator);
return builder.create();
}
这并不能解决我的问题,因为我在整个应用程序中使用android.preference.DialogPreference以及在需要时创建对话框。我无法更改由DialogPreference创建的对话框的标题格式 –