Skip to content
Khoa Pham@onmyway133

How to scale image in NSButton in AppKit

1 min read

From https://developer.apple.com/documentation/appkit/nsbutton/2202284-imagescaling

The scaling mode applied to make the cell’s image fit the frame of the image view.

let button = NSButton()
button.imageScaling = .scaleProportionallyUpOrDown
button.image = NSImage(named: NSImage.Name("image"))

Type to search titles and full text.

↑ ↓ move↵ openPagefind