我有一个使用Core Graphics自定义绘制的按钮,我想要更改它,以便使用圆角和白色笔划圆边框绘制。我也在设置背景图片。
func imagePickerController(picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [String : AnyObject]) {
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
myButton.layer.cornerRadius = // Nothing Give me here circle
myButton.clipsToBounds = true
myButton.layer.borderWidth = 12.0
myButton.layer.borderColor = UIColor.whiteColor().CGColor
myButton.setBackgroundImage(pickedImage, forState: .Normal)
myButton.setNeedsDisplay()
}
dismissViewControllerAnimated(true, completion: nil)
}
这是我申请myButton.layer.cornerRadius = myButtonrect.size.height/2