【发布时间】:2014-10-09 12:55:35
【问题描述】:
我有一个 NSView 的子类,但我不知道应该调用什么函数来更改 alpha 值。在目标 c 中很容易:
[self setAlphaValue: 0.5];
但很快我就找不到合适的功能了。
override func drawRect(dirtyRect: NSRect){
backgroundColor.set()
// self alphaValue(0.56)
let bezierPath = NSBezierPath(roundedRect:self.bounds, xRadius:self.frame.size.width/2, yRadius:self.frame.size.width/2)
bezierPath.lineWidth = 2.0
bezierPath.fill()
}
谢谢,抱歉我的英语不好。
【问题讨论】: