【问题标题】:PopOver For Annotation View注释视图的 PopOver
【发布时间】:2012-11-13 16:41:26
【问题描述】:

嗯,我有一个问题?我很困惑!

我有一个放置注释的地图视图。现在我想要一个用于注释的弹出框。

我应该怎么做

1.在storyboard中创建一个popover控制器,并通过delgate方法推送。 2.通过所有子视图和东西创建一个程序化弹出视图?

我想使用第一种方法,任何人都可以帮助我。

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control

{ // UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"annotationPopUp"]; [self performSegueWithIdentifier: @"annotationPush" sender:nil]; }

【问题讨论】:

    标签: ios storyboard mapkit mkannotation mkannotationview


    【解决方案1】:

    mapView:didSelectAnnotationView 在你的班级中制作你的弹出框(最好是一个属性)并按下它。这是一个例子:

    - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
    {
        self.popover = [[UIPopoverController alloc] initWithContentViewController:yourViewController];
    
        [self.popover presentPopoverFromRect:view.bounds 
                                      inView:view   
                    permittedArrowDirections:UIPopoverArrowDirectionAny 
                                    animated:YES];
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多