Android add custom animation to Toast

半城伤御伤魂 提交于 2019-12-01 10:43:25

It is not possible to do this with the stock Android Toast class. Stock style toasts (ones added to the WindowManager and not to a ViewGroup) are limited to four system animations and will not accept animations from your project. If you would like to use different system animations with stock type Android Toasts check out how I do it in my SuperToasts library. It may not be worth it to write such a class for one instance so I would recommend either using my library if you find it useful or writing a custom view class that resembles a toast. You can see how I do that in this class of the library.

Toasts are displayed using a system that can't be changed so answer is no you cant change the toast animation. however you can make your own view that resembles a toast and animate it however you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!