我试图添加一个UIView作为MapKitAnnotation的leftCalloutAccessoryView,但我添加到UIView的textlabel没有显示,我不明白为什么?
let orderInfoView = UIView(frame: CGRectMake(0, 0, 100, annotationView!.frame.size.height))
orderInfoView.backgroundColor = UIColor.blackColor()
let textLabel = UILabel(frame: CGRectMake(0, 0, 100, 10))
textLabel.text = "Foobar"
textLabel.textAlignment = .Center
orderInfoView.addSubview(textLabel)
annotationView?.leftCalloutAccessoryView = orderInfoView
[UPDATE]
这是破坏它的代码片段,将其改为数字常量使其工作。
annotationView!.frame.size.height