简体   繁体   中英

Change Image of NSButton

Im trying to change the background image of my button but it gives me this error:

Value of type '(NSButton) -> ()' has no member 'image'

likeButton.image = NSImage(named: NSImage.Name("like"))

You can use setBackgroundImage function to change it.

For example

likeButton.setBackgroundImage(anImage, for: UIControl.State.normal)

Are you working on swift or objective C

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM