自定義漂亮的toast

使用

顯示一個錯誤消息:

Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();

顯示成功消息:

Toasty.success(yourContext, "Success!", Toast.LENGTH_SHORT, true).show();

顯示提示消息:

Toasty.info(yourContext, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();

顯示警告消息:

Toasty.warning(yourContext, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();

顯示不帶圖標的消息:

Toasty.normal(yourContext, "Normal toast w/o icon").show();

顯示帶自定義圖標的消息:

Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();

顯示自定義消息:

Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, textColor, tintColor, duration, withIcon, true).show();

demo下載http://download.csdn.net/detail/qq_35549248/9847624


發佈了47 篇原創文章 · 獲贊 55 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章