如何在android中为按钮获取像iphone一样的动画
我看到一个 iPhone 应用程序,如果该按钮可见并且我们按下取消按钮,那么该按钮应该消失。在这种情况下,会有动画“按钮从左到右排列,最后消失”。在 Android 中,我可以旋转任何视图或将其从左向右移动。但是我怎样才能获得按钮破坏动画并使按钮在该类型的动画中可见的效果。
谢谢迪帕克
I saw one iphone application if the button is visible and we press cancel button then that button should gone. in that case there is animation "the button diposes from left to right and finally got vanished". In android i am able to rotate any view or move it from left to right. But how can i get the effect that the button destroy animation and make a button visible in that type of animation.
Thanks
Deepak
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定我是否完全理解您想要做什么,但您似乎想要淡出按钮并翻译它。如果是这种情况,那么您可以使用 Alpha 动画来更改按钮的不透明度。通过逐渐将 Alpha 值减小到 0,该按钮将看起来逐渐消失。
我最近在我的博客上完成了一系列动画。最好按顺序从第一篇开始阅读文章,但是最后一篇文章介绍了单个小部件的动画。
I'm not sure that I fully understand what you're trying to do, but it seems like you want to fade the button as well as translating it. If that's the case, then you can use alpha animations to change the opacity of the button. By gradually reducing the alpha to 0, the button will appear to fade away.
I have recently completed a series on animations on my blog. It is probably best to read the articles in order starting with the first, but the final article covers animating individual widgets.
要大致了解 Android 中的动画,请查看这个关于快速操作的精彩页面。有大量具有不同选项的代码和工作动画,因此您可以获得有关它们如何工作的完整教程。
如何创建快速操作对话框
To get a general idea of animations in android, check out this awesome page on quick actions. There is plenty of code and working animations with different options so you can get a full tutorial of how they work.
How to create quick action dialog