当前位置:网站首页>Change the background color of a pop-up dialog

Change the background color of a pop-up dialog

2022-07-05 01:27:00 Bustling city

problem :

I wrote android code that shows a pop-up dialog but I want to change the background color from black to white , and then the color of the writing. I wrote a program that displays pop-up dialog android Code , But I want to change the background color from black Change to white , Then change the color of the text .

This is the dialog's code: This is the code of the dialog box :

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    }

Solution :

Reference resources : https://stackoom.com/en/question/1Eys4
原网站

版权声明
本文为[Bustling city ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141032019321.html

随机推荐