【问题标题】:How to scale axes independently at runtime on an NSButton如何在运行时在 NSButton 上独立缩放轴
【发布时间】:2011-05-01 22:35:35
【问题描述】:

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

【问题讨论】:

    标签: cocoa macos nsimage objective-c-runtime nsbutton


    【解决方案1】:

    您应该可以使用the button’s cell 进行设置:

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

    有关图像缩放选项的列表,请参阅here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-06
      • 2023-03-13
      • 2016-06-19
      相关资源
      最近更新 更多