以编程方式拖动视图
I'm writing playing cards game. I have implemented dragging and dropping one view onto another based on this tutorial.
Now I want to animate opponent moves.
Is there easy way to to this?
I thought about using TouchUtils.dragViewBy(...)
, but it isn't supported on device.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于对手的移动,你不应该使用动画吗?
为此,您可以使用旧 API 或新的,或使用 兼容性库 代替。
请注意,如果您在旧的 Android 版本(即使使用兼容性库)(即 API 10 及以下版本)上运行动画,则视图看起来只会位于您看到的位置,但实际上它停留在原始位置。
for opponents move, shouldn't you use animations instead?
for this, you could use either the old API or the new one, or use a compatibility library instead .
do note that if you run animations on old android versions (even with the compatibility library) meaning API 10 and below, the view only looks to be on the position that you see it, but actually it stayed on the original position.