我的地图上有一组注释,每个注释都有一个正确的标注按钮。当调用该按钮时,它会打开一个弹出窗口,我可以轻松创建,但我无法弄清楚如何使用弹出窗口中的标题等特征来填充它。这是我的代码
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.2];
[_infoview setAlpha:1];
[UIView commitAnimations];
_infoview.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:0];
[UIView setAnimationDuration:0.3/1.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounceInfoAnimation)];
[self.view addSubview:_popView];
_infoview.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
[UIView commitAnimations];
lblTitle.text = pawpost.title;
}
现在我的问题是如何在窗口中填充标题。我需要尝试通过此功能完成所有操作吗?一个不同的功能?或者我是否需要创建一个全新的文件来编写它?
我还试图单独设置一个按钮来调用所选位置的电话号码。这是我的代码,但“pawpost.phone”不对应。
-(IBAction)callPhone:(id)sender {
NSString* yourActualNumber = [NSString stringWithFormat:@"tel:%@",pawpost.phone];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:yourActualNumber]];
NSLog(@"phone");
}