0
A
回答
1
你好你添加资产给你项目还是只有一个图像?
因此,您需要将图像资源(bigMarker.png,[email protected],[email protected])添加到项目资产中,如截图。这工作正常在iOS 9
,而我的代码示例中的viewDidLoad
// Add custom position in Kansas
CustomAnnotation *annotation = [CustomAnnotation new];
annotation.title = @"Elevation Burger";
annotation.subtitle = @"The best buns...";
annotation.coordinate = CLLocationCoordinate2DMake(39.0119020f,-98.4842460f);
[self.myMap addAnnotation:annotation];
而这其中的代表
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
MKAnnotationView *annotationView = nil;
if (annotation != mapView.userLocation) {
annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:nil];
annotationView.canShowCallout = YES;
annotationView.image = [UIImage imageNamed:@"bigMarker"];
annotationView.leftCalloutAccessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"burgerBitmap"]];
UIButton *accessoryButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImage *disclosureButtonImage = [[UIImage imageNamed:@"disclosure"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[accessoryButton setImage:disclosureButtonImage forState:UIControlStateNormal];
annotationView.rightCalloutAccessoryView = accessoryButton;
}
return annotationView;
}
相关问题
- 1. iOS中的标记群集中的自定义标记图标
- 2. IOS谷歌地图自定义标记
- 3. 自定义地图标记
- 4. HTML标记的iOS自定义字体
- 5. Angular Leaflet自定义标记图标
- 6. 自定义标记图标动画
- 7. Android自定义标记图标
- 8. react-google-maps自定义标记图标
- 9. 如何在iOS中设置自定义标记图标与标记簇Swift
- 10. android:地图上一些标记质量差
- 11. 自定义标记
- 12. 设置自定义标记图像会覆盖默认标记图标以及自定义图标
- 13. iOS。标签栏图标在模拟器上质量较差。怎么修?
- 14. 谷歌地图自定义标记不显示为我的自定义图标
- 15. 在谷歌地图上闪烁的自定义标记iOS
- 16. 将Google Maps标记图标更改为自定义图标
- 17. 自定义iOS加载图标
- 18. 谷歌地图标记定位与自定义图标
- 19. iOS自定义标签栏
- 20. iOS Mapkit自定义标注
- 21. Google地图标记的自定义图标
- 22. 黑莓地图自定义标记
- 23. 自定义谷歌地图标记
- 24. 自定义Google地图标记HTML
- 25. Android - 动态自定义地图标记
- 26. Highcharts气泡图,自定义标记
- 27. 角度材质自定义标签
- 28. 自定义标记上传
- 29. Jsf 2.0自定义标记
- 30. matplotlib自定义标记
没有,只是一个形象 – niskatqq
@niskatqq我刚刚编辑了我的评论,所以请尝试 –
现在感谢我了解 – niskatqq