如何将android中的动画链接到同一个视图?
我得到了一些文本浏览量,我想制作MSN的嗡嗡声效果。
我的计划是:
- 观察视图,假设向左倾斜 10 次,然后
- 将其带回起始位置,
- 然后向上倾斜 10 次,
- 然后再
- 向左向下倾斜
- ...等等。
我的观点是,我想将一些动作设置为一个视图,并且需要一个接一个地执行。
我怎样才能做到这一点?
I got some text views and I want to make the buzz effect of MSN.
My plan is:
- take the view, let say 10dip to the left,
- take it back to its start position
- after that take it 10dip up
- then back
- down back
- left... and so on.
My point is, I have some sequence of movements that I want to set to one view and that needs to execute one after another.
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能是指 AnimatorSet (不是 AnimationSet)。正如文档中所写:
动画将
view
移动-100px
,持续700ms
,然后在300ms
期间消失:You probably mean AnimatorSet (not AnimationSet). As written in documentation:
Animation which moves
view
by-100px
for700ms
and then disappears during300ms
:我有一个 sdk 15 兼容类的开始,可用于构建复杂的动画链希望它对某人有所帮助。您应该能够遵循设计模式来添加您自己的方法。如果您这样做,请在这里评论,我将更新答案,干杯!
I have the beginnings of an sdk 15 compatible class that can be used to build complex animation chains hope it helps someone. You should be able to follow the design pattern to add your own methods. If you do please comment them here and I will update the answer, Cheers!
使用 AnimationSet:
Use an AnimationSet: