How to scale axes independently at runtime on an NSButton
In Interface Builder, you can select how you want a button's image to be scaled, choosing either Axes Independent, Proportionally开发者_如何学Python Down, etc. for the "Scaling" drop-down. How can I access or change this attribute of the NSButton at runtime?
You should be able to set that by using the button’s cell:
NSButton *someButton;
NSButtonCell *someButtonCell = [someButton cell];
[someButtonCell setImageScaling:NSImageScaleAxesIndependently];
For the list of image scaling options, see here.
精彩评论