gpt4 book ai didi

ios - MKAnnotationView 标注中的反转文本

转载 作者:行者123 更新时间:2023-11-30 13:50:47 26 4
gpt4 key购买 nike

我使用此代码在 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

最佳答案

将 View 的 semanticContentAttribute 设置为 .ForceLeftToRight 以防止在语言从右向左书写的系统下发生逆转。

关于ios - MKAnnotationView 标注中的反转文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34316289/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com