Reputation: 8068
In Xcode 6.3, on creating a text view, there are 4 options given for the border style.
The rounded corner border style provides the option of changing the opacity of the background (not the text).
The square corner border style's alpha value only changes the opacity of the text, and not the background of the text field.
How do I have a square-cornered text field with a 0.5 Alpha value for background opacity, but a 0.0 Alpha Value for text opacity?
Upvotes: 1
Views: 3839
Reputation: 2400
You can set any combination you want programmatically. Eg:
override func viewDidLoad() {
super.viewDidLoad()
let backColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
myTextField.backgroundColor = backColor
let textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
myTextField.textColor = textColor
}
You could also set the background or text color to Clear Color
in the Attributes inspector.
Upvotes: 2