【发布时间】:2021-05-27 05:19:49
【问题描述】:
我想知道如何放大 UIButton 中的 UIImage,以便在放大以填充按钮时,它具有锐利的边缘,而不是模糊?
即用于 8 位样式的艺术品。我保存的 UIImage 为 64 x 64 px,但显示在更大的框架上。
let imageToDisplay = UIImage(named: "PixelImage")
theButton.setBackgroundImage(imageToDisplay, for: .normal)
【问题讨论】:
-
关闭抗锯齿并自己重画大一点?