MKAnnotationView标注中的反转文本

时间:2015-12-16 15:46:49

标签: ios iphone swift mkmapview

我正在使用此代码在Swift中创建一个简单的MKAnnotationView标注。

    let local_parking = CustomAnnotation()
    local_parking.coordinate = parking.coordinate.coordinate
    local_parking.title = "Street name"
    local_parking.subtitle = "Click on the button to get there"
    self.mapView.addAnnotation(local_parking)
}
.
.
.
func mapView(mapView:MKMapView, viewForAnnotation annotation:MKAnnotation) -> MKAnnotation? {
    ...
    let customAnnotation = annotation as! CustomAnnotation
    annotationView?.canShowCallout = true

    let accessoryButton : UIButton = UIButton(type: .DetailDisclosure)
    annotationView!.rightCalloutAccessoryView = accessoryButton

    return annotationView
}

我不知道为什么有些标注会出现倒置而其他标注正常显示。

enter image description here

1 个答案:

答案 0 :(得分:0)

将您的观看次数semanticContentAttribute设置为.ForceLeftToRight,以防止在语言从右向左书写的系统下出现逆转。