有没有办法让标注的左侧附件视图只用背景颜色填充视图的其余部分?
我目前正在使用此
let leftView = UIImageView(image: UIImage(named: "leaf32"))
leftView.backgroundColor = UIColor.redColor()
anView.leftCalloutAccessoryView = leftView
答案 0 :(得分:4)
这样做:
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