2014-09-02 111 views
0

我已经在地图视图中使用了几个MKPointAnnotation。iOS背景MKPointAnnotation

所有的工作,但是,视图的MKPoiintAnnotation的“背景”是“不可见的”,所以它不是很“可见”。

我想改变TE背景为白色,我试图用:

  • (MKAnnotationView *)的MapView:(的MKMapView *)的MapView viewForAnnotation:(ID)注释

但我没用这种方法不能成功改变背景。我需要使用什么? THX,

编辑:所谓 “背景”,我想意思是,文本 “当前位置”(在这个例子中)下的背景:

enter image description here

编辑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]; 
+0

你是什么“背景”是什么意思? – Mike 2014-09-02 14:22:17

+0

等一下,我拍屏幕:) – deveLost 2014-09-02 14:23:09

+0

我编辑了我的帖子。 – deveLost 2014-09-02 14:26:01

回答

0

如果你的MapView的是一个UITableView内,那么你需要设置selectionStyle到UITableViewCellSelectionStyle.None。

例如,在斯威夫特,我添加了以下到自定义表格单元格类的awakeFromNib功能:

override func awakeFromNib() { 
    super.awakeFromNib() 

    // Selection style for the cell 
    self.selectionStyle = UITableViewCellSelectionStyle.None 
}