ios - UITextField border color -
It's great to set me your color in the UITextField range but so far I could know how the style of the border line To change
I have used background property to set the background color in this way:
self.textfield .backgroundColor = textFieldColor; But I have to change the color of the UitextField border too. And my question was how to change the border color.
import quartzcoser outline in your category:
#import & lt; Quartzcore / Quartzcoreot & gt; To change the border color, use the following code snippet (I'm setting it in red),
textField.layer .cornerRadius = 8.0f; TextField.layer.masksToBounds = Yes; TextField.layer.borderColor = [[UIColor redColor] CGColor]; TextField.layer.borderWidth = 1.0f; To return to the original layout, simply set the border color to clear the color,
serverField.layer.borderColor = [[UIColor clearColor ] CGColor]; In fast code
textField.layer.borderWidth = 1 textField.layer.borderColor = UIColor.whiteColor (). CGColor
Comments
Post a Comment