1

I'm trying to add a UIView as the leftCalloutAccessoryView of a MapKitAnnotation but the textlabel I add to the UIView is not being shown and I don't understand why?

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]

This was the piece of code which broke it, changing it to a numerical constant made it work.

annotationView!.frame.size.height
user3054852
  • 179
  • 1
  • 11

0 Answers0