Square checkBox with different backgrounds
coolcool1994 opened this issue · 1 comments
coolcool1994 commented
If I have white, square checkbox on top of the black view, the white background would be a square despite the fact that the corner radius is set to 5.0 . I had to put a white view behind the transparent checkbox and put corner radius there in order to make the checkbox appear to be white xD. Please fix this.
Akamajin commented
You should change the corner radius of layer. like this:
let checkbox = M13Checkbox(frame: CGRect(x: 0, y: 0, width: 30.0, height: 30.0))
checkbox.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
checkbox.layer.cornerRadius = 5
myCheckboxContainerView.addSubview(checkbox)