我编写了显示弹出对话框的 android 代码,但我想将背景颜色从 black 更改为 white ,然后是文字的颜色。
这是对话框的代码:
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
Boolean welcomeScreenShown = mPrefs.getBoolean(welcomeScreenShownPref, false);
if (!welcomeScreenShown) {
String whatsNewText = getResources().getString(R.string.Text);
new AlertDialog.Builder(this).setMessage(whatsNewText).setPositiveButton(
R.string.ok, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).show();
SharedPreferences.Editor editor = mPrefs.edit();
editor.putBoolean(welcomeScreenShownPref, true);
editor.commit(); // Very important to save the preference
}