我试图更改按钮的背景图像,但它给了我这个错误:
Value of type '(NSButton) -> ()' has no member 'image'
likeButton.image = NSImage(named: NSImage.Name("like"))
最佳答案
您可以使用setBackgroundImage
函数来更改它。
例如
likeButton.setBackgroundImage(anImage, for: UIControl.State.normal)
关于swift - 更改 NSButton 的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58581466/