开发者

MKMapView Popup Bubble: show new xib on click

开发者 https://www.devze.com 2023-04-11 20:00 出处:网络
How do I load a new xib when my user taps on the popup bubble on an MkMapView? I\'ve tried scouring the interne开发者_JAVA百科t, but can\'t find a solution to this problem.

How do I load a new xib when my user taps on the popup bubble on an MkMapView?

I've tried scouring the interne开发者_JAVA百科t, but can't find a solution to this problem.

Many thanks in advance,


In the - (void)mapView:(MKMapView *)aMapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control method you should create a new VC with your xib and push it to the navigation controller or display it however you want. For example:

- (void)mapView:(MKMapView *)aMapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{
     NewViewController* vc = [[[NewViewController alloc] initWithNibName:@"newXib" bundle:nil] autorelease];
     [self.navigationController pushViewController:vc animated:YES];
}

You can find a lot of tutorials how to create and display new Views, you should start scouring harder. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消