How can I change default toast message color and background color in android?

后端 未结 15 890
执念已碎
执念已碎 2020-12-23 17:12

I want to create a toast message with background color is white and message color is black. My toast message is:

Toast.makeText(Logpage.this, \"Please Give          


        
15条回答
  •  余生分开走
    2020-12-23 18:03

    use this way

    Toast toast = Toast.makeText(MainActivity.this, R.string.toastMessage, Toast.LENGTH_LONG);   
    toast.getView().setBackgroundColor(Color.parseColor("#F6AE2D"));
    toast.show();
    

提交回复
热议问题