UIButton Background Image Stretching with 9-slicing

Thomas Mak wrote at 2018-10-19.

let buttonImage = UIImage(named: "button.png")?.resizableImage(withCapInsets: UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5))
testButton.setBackgroundImage(buttonImage, for: .normal)

Comments

no comments yet.