0
我正在基于macruby和hotcocoa框架的项目工作。我不知道客观的c。在我的项目中,我想改变按钮颜色(NSButton)。你知道如何使用hotcocoa mappers或macruby来实现吗?hotcocoa按钮背景颜色
我正在基于macruby和hotcocoa框架的项目工作。我不知道客观的c。在我的项目中,我想改变按钮颜色(NSButton)。你知道如何使用hotcocoa mappers或macruby来实现吗?hotcocoa按钮背景颜色
不直接支持设置NSButton的背景颜色。创建自定义按钮的强大方法是子类化NSButton并覆盖drawRect :.另一种方法是使用CALayers自定义按钮。
layer = CALayer.layer
layer.backgroundColor = NSColor.orangeColor.CGColor
button.setLayer layer
button.setWantsLayer true