Objective-C将MKOverlay添加到地图视图中的动画淡入 [英] Objective-C add MKOverlay to map view animated fade in

查看:77
本文介绍了Objective-C将MKOverlay添加到地图视图中的动画淡入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试向带有动画的地图添加MKOverlay.我正在尝试使其在添加时淡入并在删除时淡出.是否可以通过创建自定义叠加层类或叠加层视图类来完成此操作?

I've been trying to add an MKOverlay to a map with animation. I'm trying to make it fade in when it's added and fade out when it's removed. Could this be done by created a custom overlay class or overlay view class?

推荐答案

在iOS 7上,即使使用新的MKOverlayRenderer,也可以实现此目的.它具有alpha 属性您可以通过设置计时器以重复更改其值并调用setNeedsDisplayInMapRect:zoomScale:来制作动画.

On iOS 7 you could achieve this even with the new MKOverlayRenderer. It has an alpha property which you could animate by setting up a timer to repeatedly change its value and call setNeedsDisplayInMapRect:zoomScale:.

这篇关于Objective-C将MKOverlay添加到地图视图中的动画淡入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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