Maps v2标记动画-淡入和淡出 [英] Maps v2 marker animation - fade in and out

查看:89
本文介绍了Maps v2标记动画-淡入和淡出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个 GoogleMap 标记?

这是我向地图添加标记的方法:

    marker = map.addMarker(new MarkerOptions()
            .position(point)
            .title(title)
            .snippet(text)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))
    );

解决方案

在Google Play服务4.0+中,您可以将Marker.setAlphaHandler结合使用,每隔几毫秒发布一次Runnable.

代码将类似于我在这里的答案GoogleMap marker?

This is how I add a marker to the Map:

    marker = map.addMarker(new MarkerOptions()
            .position(point)
            .title(title)
            .snippet(text)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))
    );

解决方案

With Google Play services 4.0+ you can use Marker.setAlpha in conjunction with Handler that posts some Runnable every few milliseconds.

The code will be similar to my answer here Drop marker slowly from top of screen to location on android map V2. Just setAlpha instead of setPosition and you are on your way home.

这篇关于Maps v2标记动画-淡入和淡出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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