我有自定义的textField具有@IBInspectable财产placeHolderColor: UIColor和正常工作。我通过以下方式设置:
attributedPlaceholder = NSAttributedString(string: placeHolder, attributes:[NSAttributedStringKey.foregroundColor: placeHolderColor])
Run Code Online (Sandbox Code Playgroud)
如何以编程方式仅为此属性设置不透明度值,而不是为文本字段中的普通文本设置不透明度值?我没有找到任何匹配NSAttributedStringKey来执行此操作