iOS背景MKPointAnnotation
问题描述:
我已经在地图视图中使用了几个MKPointAnnotation。iOS背景MKPointAnnotation
所有的工作,但是,视图的MKPoiintAnnotation的“背景”是“不可见的”,所以它不是很“可见”。
我想改变TE背景为白色,我试图用:
- (MKAnnotationView *)的MapView:(的MKMapView *)的MapView viewForAnnotation:(ID)注释
但我没用这种方法不能成功改变背景。我需要使用什么? THX,
编辑:所谓 “背景”,我想意思是,文本 “当前位置”(在这个例子中)下的背景:
编辑2:
我“使用此代码添加注释:开始
annotationPoint = [[MKPointAnnotation alloc] init];
annotationCoord.latitude = [[item getPlace] getLatitude];
annotationCoord.longitude = [[item getPlace] getLongitude];
annotationPoint.coordinate = annotationCoord;
annotationPoint.title = item.getNom;
annotationPoint.subtitle = [Utils getDateString :item.getDeadline :@"dd/MM/yyyy HH:mm"];
[_mapView addAnnotation:annotationPoint];
答
你需要建立一个自定义的注释,你可能要遵循本教程:
http://blog.asynchrony.com/2010/09/building-custom-map-annotation-callouts-part-2/
答
如果你的MapView的是一个UITableView内,那么你需要设置selectionStyle到UITableViewCellSelectionStyle.None。
例如,在斯威夫特,我添加了以下到自定义表格单元格类的awakeFromNib功能:
override func awakeFromNib() {
super.awakeFromNib()
// Selection style for the cell
self.selectionStyle = UITableViewCellSelectionStyle.None
}
你是什么“背景”是什么意思? – Mike 2014-09-02 14:22:17
等一下,我拍屏幕:) – deveLost 2014-09-02 14:23:09
我编辑了我的帖子。 – deveLost 2014-09-02 14:26:01