开发者

Custom UITextField

I know that it has been asked before but I hadn't seen any answers that I could use. So I am sorry for asking a repeat Q but it is kind of important. So is there any way to change the background color of a rounded UITextField. I have RGB values that I want to use but I can only change the corners us开发者_如何学JAVAing the background property.


It looks like this answer covers what you need. In short, rounded UITextFields are drawn with a bunch of other UIImageViews behind the scenes, so you need to change the button style to something else and then make the modifications you need.


You could set the background of UITextField using background property , I could not find setting color as background in the documentation for UITextField So you could consider using an image, which is formed from your RGB values,and set the as background of your text field.

@property(nonatomic, retain) UIImage *background

Like below.

myTextfield.background = [UIImage imageNamed:@"myImage.png"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜