在 Mapbox 中,你在哪里设置 callout dismissal 是否是动画的?
In Mapbox, where do you set if callout dismissal is animated or not?
在 Mapbox MGLCalloutView
协议中,存在动画关闭标注视图的方法:
func dismissCallout(animated: Bool) {
if animated {
// perform animation
} else {
removeFromSuperview()
}
}
但是,animated
参数原来是在哪里设置的呢?我在哪里设置布尔值 true 或 false?
如果您允许地图取消标注,则会自动设置 animated
。如果您想自己处理这个问题,您可以在显示标注的注释上调用 -[MGLMapView deselectAnnotation:animated:]
。
在 Mapbox MGLCalloutView
协议中,存在动画关闭标注视图的方法:
func dismissCallout(animated: Bool) {
if animated {
// perform animation
} else {
removeFromSuperview()
}
}
但是,animated
参数原来是在哪里设置的呢?我在哪里设置布尔值 true 或 false?
如果您允许地图取消标注,则会自动设置 animated
。如果您想自己处理这个问题,您可以在显示标注的注释上调用 -[MGLMapView deselectAnnotation:animated:]
。