具有大于框架的突出显示图像的 UIButton
UIButton with highlight image that is bigger than frame
UIButton
是否有可能有比 UIButton's
frame
大的高亮图像(我想保留 UIButton's
frame
所以它是 UIControlStateNormal
图片的大小,而不是 UIControlStateHighlight
图片的大小。
是的,这是可能的:
button.imageView?.contentMode = .center
button.imageView?.clipsToBounds = false
UIButton
是否有可能有比 UIButton's
frame
大的高亮图像(我想保留 UIButton's
frame
所以它是 UIControlStateNormal
图片的大小,而不是 UIControlStateHighlight
图片的大小。
是的,这是可能的:
button.imageView?.contentMode = .center
button.imageView?.clipsToBounds = false