4

在 Interface Builder 中,您可以选择按钮图像的缩放方式,为“缩放”下拉菜单选择 Axes Independent、Proportionally Down 等。如何在运行时访问或更改 NSButton 的此属性?

4

1 回答 1

10

您应该可以使用按钮的单元格进行设置:

NSButton *someButton;

NSButtonCell *someButtonCell = [someButton cell];
[someButtonCell setImageScaling:NSImageScaleAxesIndependently];

有关图像缩放选项的列表,请参见此处

于 2011-05-01T22:39:27.643 回答