2015-04-06 107 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