Muddz Muddz - 3 months ago 29
Android Question

How to define a Toast style in style.xml?

Can a

be styled in
like we do for Activity themes?

I want to style the following:

  • Text color

  • Text Size

  • Text font

  • Background color/opacity

  • Background Radius of corners and sizes

I can't find anything that relates to Toast on the web or in the style.xml

I have solved it by making an StyleableToast class which you can easily use to style your Toasts in almost any way! See answer here:


Since there was not an easy and a non messy way (layouts,inflating etc) to style a Toast, I decicided then to make a complete Styleable Toast class with a lot of styling possibilities!

I will keep improve the Styleable Toast class and make it feature rich and release it in the jCenter() so it can be added as an dependency

Here is it. Just a single class you put in your project:

Examples of toasts made with StyleableToast:

enter image description here

All feedback and feature requests is welcome!