2015-12-16 27 views
0

我正在使用此代碼在Swift中創建一個簡單的MKAnnotationView標註。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

+0

您並未真正顯示回答問題所需的任何關鍵代碼/信息。 – matt

+0

我只是顯示了與註釋聲明和AnnotationView創建相關的代碼片段。你需要哪些其他代碼來解決這個問題? –

+0

如何實際創建視圖,以及您的應用如何本地化? – matt

回答

0

下,其語言編寫從右到左的系統設置您的視圖的semanticContentAttribute.ForceLeftToRight防止逆轉。

+0

設置以下幾個方面並未解決問題。 annotationView!.semanticContentAttribute = .ForceRightToLeft –

+0

從右到左是左到右的相反... – matt

相關問題