You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm adding buttons programatically. This is what I have and I can't seem to get the background image, shadow and animation working. All works when I add a button in storyboard view.
let button = PMSuperButton() //UIButton()
let bgrImage = UIImage(named: "someImage")
//button.setImage(bgrImage, for: .normal) //-> this works ok
button.setBackgroundImage(bgrImage, for: UIControl.State.normal)
button.shadowColor = UIColor.gray
button.shadowOffset = CGSize(width: 2, height: 2)
button.shadowRadius = 2
button.shadowOpacity = 2
button.animatedScaleWhenSelected = 1
button.animatedScaleWhenHighlighted = 1
button.animatedScaleDurationWhenSelected = 1
button.animatedScaleDurationWhenHighlighted = 1
Any idea what am I doing wrong?
The text was updated successfully, but these errors were encountered:
Hi,
I'm adding buttons programatically. This is what I have and I can't seem to get the background image, shadow and animation working. All works when I add a button in storyboard view.
Any idea what am I doing wrong?
The text was updated successfully, but these errors were encountered: