tnek316
tnek316

Reputation: 640

Default callout fill in the color of the left accessory view

Is there a way to get the left accessory view of the callout to just fill in the rest of the view with a background color? Current callout

I am currently just doing it with this

let leftView = UIImageView(image: UIImage(named: "leaf32"))
leftView.backgroundColor = UIColor.redColor()
anView.leftCalloutAccessoryView = leftView

I want to have the background fill like the blue in the apple maps default callout. Apples map callout

Upvotes: 2

Views: 496

Answers (1)

Ahmed Onawale
Ahmed Onawale

Reputation: 4050

Do this:

let leftView = UIImageView(image: UIImage(named: "leaf32"))
leftView.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
leftView.backgroundColor = UIColor.redColor()
anView.leftCalloutAccessoryView = leftView

Upvotes: 4

Related Questions