How to make border and style of NStextField like that (except icon on the right)? Is it custom or built-in?
CodePudding user response:
Set new CALayer
and play with isBezeled
and isBordered
properties before setting colors.
let field = NSTextField()
field.layer = CALayer()
field.wantsLayer = true
field.isBezeled = false
field.isEditable = true
field.isBordered = true
field.backgroundColor = NSColor.white
field.layer?.borderColor = NSColor.gray.cgColor
field.layer?.backgroundColor = NSColor.white.cgColor
field.layer?.borderWidth = 1
field.layer?.cornerRadius = 5