动画在Android的吐司消息 [英] Animation for Toast messages in Android

查看:269
本文介绍了动画在Android的吐司消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下,如果它是可能有动画敬酒的消息为Android。例如,用户注册成功后,从顶部出现敬酒消息,并在2秒钟后消失。我坚信,这些小细节让应用程序很好看。

I would like to ask if it is possible to have animated toast messages for Android. For example,after the successful registration of a user,a toast message appears from the top and goes away after 2 seconds. I strongly believe that those small details make an app to look great.

推荐答案

这是不可能使一个自定义动画敬酒,与股票的Andr​​oid吐司类。

股票风格的祝酒词(的人加入到窗口管理器,而不是一个
  的ViewGroup)被限制为四个系统的动画和不接受
  动画从您的项目。

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.

因此,要实现动画或自定义吐司消息的唯一方法是创建自己的自定义类面包,或者使用一些库,如这一个的 SuperToasts库

So the only way to implement animation or a custom Toast message is to create your own custom Toast class, or use some library such as this one SuperToasts library

这篇关于动画在Android的吐司消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆