設定Toast字型顏色

ProgrammerTao發表於2015-04-24
String m_Str = "Test Toast text color";
String m_ToastStr = "<font color='#EE0000'>"+m_Str+"</font>";

Toast.makeText(this, Html.fromHtml(m_ToastStr), Toast.LENGTH_LONG).show();


下面是解決Toast在佇列中挨個顯示:

static private Toast mToast;  

if(mToast == null) {  
 mToast = Toast.makeText(_pEngine.getGameContext(), pMessage, Toast.LENGTH_LONG);  
} else {  
mToast.setText(pMessage); 
mToast.setDuration(Toast.LENGTH_LONG);  
}  
mToast.show();

相關文章