Ser Pounce
Ser Pounce

Reputation: 14571

UIButton with highlight image that is bigger than frame

Is it possible for a UIButton to have a highlight image that is larger than the UIButton's frame (I want to keep UIButton's frame so that it's the size of the UIControlStateNormal image, not the UIControlStateHighlight image).

Upvotes: 0

Views: 41

Answers (1)

André Slotta
André Slotta

Reputation: 14040

Yes, that is possible:

button.imageView?.contentMode = .center
button.imageView?.clipsToBounds = false

Upvotes: 1

Related Questions