Iphone 集成MAPKIT并添加辅助功能箭头
我遵循这一点,将Iphone 集成MAPKIT并添加辅助功能箭头,iphone,objective-c,ios,mapkit,Iphone,Objective C,Ios,Mapkit,我遵循这一点,将MAPKIT添加到我的应用程序中,并在地图上显示一些数据,如图所示 我需要在地图描述中找到蓝色箭头(辅助功能控制)。我的代码如下,如何在上面添加蓝色的辅助功能箭头 - (void)viewDidLoad { [super viewDidLoad]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES];
MAPKIT
添加到我的应用程序中,并在地图上显示一些数据,如图所示
我需要在地图描述中找到蓝色箭头
(辅助功能控制)。我的代码如下,如何在上面添加蓝色的辅助功能箭头
- (void)viewDidLoad {
[super viewDidLoad];
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 22.569722 ;
region.center.longitude = 88.369722;
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapView setRegion:region animated:YES];
[mapView setDelegate:self];
DisplayMap *ann = [[DisplayMap alloc] init];
ann.title = @" Kolkata";
ann.subtitle = @"Mahatma Gandhi Road";
ann.coordinate = region.center;
[mapView addAnnotation:ann];
}
完整的代码可以在教程中找到
以及如何编辑代码以添加自定义图像,而不是默认的红色pin?您可以在mapView:viewForAnnotation中设置蓝色箭头:
pin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];