如何在Android地图视图中为标记实现落脚动画 [英] How do i implement falling pins animation for markers in android map view

查看:143
本文介绍了如何在Android地图视图中为标记实现落脚动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法像iPhone中那样在Android中实现Google地图的掉落图钉/标记动画?

Is there any way to implement falling pins/markers animation for google maps in android like that in iPhone ???

推荐答案

Android具有叠加标记(请参见ItemizedOverlay),可轻松将图像添加到地图,但请注意,至少以我的经验,动画图像无法正常工作添加到叠加层时.

Android has overlay markers (see ItemizedOverlay) that make it easy to add images to maps, BUT note that, in my experience at least, animated images do not work when added to overlays.

我发现有必要在MapView的顶部添加一个View,并向其中添加图像,并且我已经成功地使用该方法向地图添加了可绘制动画的图像.有关更多详细信息,请参见此处: 我可以在MapView的叠加层中使用AnimationDrawable吗?/a>

I found it necessary to add a View on top of the MapView, and add imagery to that, and I've successfully added animated drawable images to the map using that approach. For more details see here: Can I use AnimationDrawable in an overlay on a MapView?

但是,老实说,您应该记住它是Android,而没有必要从iOS复制所有小功能. Android上的Google Maps不使用图钉标记,而是使用静态的蓝点-我想说的是,最好将其复制并记住您的用户是Android用户,而不是iOS用户-他们希望在Android应用程序之间保持一致.

But to be honest, you should remember that it's Android, and copying every little feature from iOS is unnecessary. Google Maps on Android doesn't use a pin marker, it uses a static blue spot - I'd say it's best to replicate that and remember your users are Android users, not iOS users - they want consistency across Android apps.

这篇关于如何在Android地图视图中为标记实现落脚动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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