addSubview dans une SpringView
Salut tout le monde,
I use the Spring library (https://github.com/MengTo/Spring) to add iOS animations to my Swift project. I have a custom subclass ChooseButton of SpringView and I want to add a subview (mySubView in this case) to this view :
class ChooseButton: SpringView {
enum TypeButton {
case YES, NO
}
var type:TypeButton!
var size:CGFloat = 90
var enabled: Bool!
var delegateButton: ChooseButtonDelegate?
init (type: TypeButton) {
super.init(frame: CGRectMake(0,0,size,size))
self.type = type
enabledButton()
if type == TypeButton.YES {
self.backgroundColor = CustomColor.Emeralde
self.center = CGPointMake(gScreenSize.width*3/4, gScreenSize.height-self.frame.size.height)
} else {
self.backgroundColor = CustomColor.Alizarin
self.center = CGPointMake(gScreenSize.width/4, gScreenSize.height-self.frame.size.height)
}
self.layer.cornerRadius = size/2
var mySubView = UIView(frame: frame)
mySubView.backgroundColor = UIColor.blackColor()
addSubview(mySubView)
}
But my Subview does not shows up... I can't see why.
Merci pour votre aide et bonne journée !
Connectez-vous ou Inscrivez-vous pour répondre.