2015-04-06 109 views

回答

1

这是斯威夫特,但它的工作对我来说:

if let cell = secureTextField.cell() as? NSTextFieldCell { 
     if let editor = cell.fieldEditorForView(secureTextField) { 
      editor.insertionPointColor = NSColor.whiteColor() 
     } 
    } 

哦,我看到的唯一区别是,我使用NSColor.whiteColor()代替clearColor()

+0

白色也适用于我,但我需要用清晰的颜色隐藏光标,因为我有彩色背景。 – 2015-04-07 13:00:11