I currently have a regular border. I would like to only have a top and bottom border.
How do I accomplish this?
Using the UITextField
's layer
property, I have the following code:
self.layer.borderColor = [[UIColor colorWithRed:160/255.0f green:160/255.0f blue:160/255.0f alpha:1.0f] CGColor];
self.layer.borderWidth = 4.0f;
I have kind of got it to work by making my UITextField extra long, so that the user does not see the left and right borders, but I was just wondering if there was a better, less hackish way of doing this?
I have checked the docs, and changing a UITextField
's borderStyle
does not have this option.
From,
An iOS First Timer
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…