MapKit 取消选择注释并且弹出窗口没有动画

发布于 2024-12-21 14:25:18 字数 773 浏览 4 评论 0原文

我有一些自定义注释,当按下标注附件控件时,会出现一个弹出窗口,显示更多信息(就像 Apple 的地图应用程序一样)。

一切都有效,除了它们没有动画,即使动画设置为“是”?

代码:

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
    [mapView deselectAnnotation:view.annotation animated:YES];

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

    _basePopupViewController = [storyboard instantiateViewControllerWithIdentifier:@"BasePopupViewController"];
    _popover = [[UIPopoverController alloc] initWithContentViewController:_basePopupViewController];

    [_popover presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
}

I have some custom annotations, and when pressed on the callout accessory control, a popup appears to show more information (like in the maps app from Apple).

Every thing works, except that they don't animate, even when animate is set to YES?

code:

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
    [mapView deselectAnnotation:view.annotation animated:YES];

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

    _basePopupViewController = [storyboard instantiateViewControllerWithIdentifier:@"BasePopupViewController"];
    _popover = [[UIPopoverController alloc] initWithContentViewController:_basePopupViewController];

    [_popover presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文