3月22日学习日志

今天学习了Toast的基本使用。

void midToast(String str, int showTime)
{
    Toast toast = Toast.makeText(global_context, str, showTime);            
    toast.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL , 0, 0);  //设置显示位置
    TextView v = (TextView) toast.getView().findViewById(android.R.id.message);
    v.setTextColor(Color.YELLOW);     //设置字体颜色
    toast.show();   
}
原文地址:https://www.cnblogs.com/20193925zxt/p/14883187.html