相反的變化,你可以創建自己的對話框的主題。這可能比找到糾正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創建的對話框的標題格式 –