【发布时间】:2011-05-01 22:35:35
【问题描述】:
在 Interface Builder 中,您可以选择按钮图像的缩放方式,为“缩放”下拉菜单选择 Axes Independent、Proportionally Down 等。如何在运行时访问或更改 NSButton 的此属性?
【问题讨论】:
标签: cocoa macos nsimage objective-c-runtime nsbutton
在 Interface Builder 中,您可以选择按钮图像的缩放方式,为“缩放”下拉菜单选择 Axes Independent、Proportionally Down 等。如何在运行时访问或更改 NSButton 的此属性?
【问题讨论】:
标签: cocoa macos nsimage objective-c-runtime nsbutton
您应该可以使用the button’s cell 进行设置:
NSButton *someButton;
NSButtonCell *someButtonCell = [someButton cell];
[someButtonCell setImageScaling:NSImageScaleAxesIndependently];
有关图像缩放选项的列表,请参阅here。
【讨论】: