我使用此代码在UIButton
中创建CalloutView
。
var button = UIButton.buttonWithType(UIButtonType.System) as! UIButton
button.frame = CGRectMake(100, 100, 100, 50)
button.backgroundColor = UIColor.redColor()
button.setTitle("No", forState: UIControlState.Normal)
button.addTarget(self, action: "Action:", forControlEvents: UIControlEvents.TouchUpInside)
anView.rightCalloutAccessoryView = button
如何更改UIButton
的文字颜色?
答案 0 :(得分:0)
您可以更改UIButton
的标题/文字颜色,如下所示:
button.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)