gpt4 book ai didi

swift - Yandex Mapkit iOS : animate placemark

转载 作者:行者123 更新时间:2023-12-05 07:14:40 24 4
gpt4 key购买 nike

我想在点击时为 YMKPlacemarkMapObject 设置动画。我试过了,但没有用。

    func onMapObjectTap(with mapObject: YMKMapObject, point: YMKPoint) -> Bool {

guard let placemark = mapObject as? YMKPlacemarkMapObject else { return false }

let iconStyle: YMKIconStyle = YMKIconStyle()

UIView.animate(withDuration: 1.0, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 5, options: .curveEaseInOut, animations: {
iconStyle.scale = 2
placemark.setIconStyleWith(iconStyle)
}) { _ in
iconStyle.scale = 1
placemark.setIconStyleWith(iconStyle)
}
}

使用 Google map 时,我可以轻松访问标记 imageView 并对其进行转换。对于 Yandex map ,我找不到访问 placemarks imageView 的方法。有没有办法访问 imageView

最佳答案

YMKPlacemarkMapObject 不支持 UIView 动画,但您可以使用 CADisplayLink 手动为 YMKPlacemarkMapObject 的任何属性设置动画。

我也想建议你提问here .在这种情况下,它将更快地(由 mapkit 开发人员)回答。

关于swift - Yandex Mapkit iOS : animate placemark,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59805224/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com