开发者

How to customize the UITextField?

开发者 https://www.devze.com 2023-04-01 12:43 出处:网络
How to Customize 开发者_如何学GoUITextField has show in the below picture .[textField setBackgroundColor:[UIColor whiteColor]];

How to Customize 开发者_如何学GoUITextField has show in the below picture

.

How to customize the UITextField?


[textField setBackgroundColor:[UIColor whiteColor]];
[textField setBorderStyle:UITextBorderStyleRoundedRect];


Just set property placeholder of your UITextField object to @"07/28/2011 4x8 Card" and use code from @Akshay


If you are on iOS3.0+, you can do a custom border using quartzcore:

#import<QuartzCore/QuartzCore.h>

textfield.borderStyle = UITextBorderStyleNone;
textfield.layer.cornerRadius = 10.0; //Adjust as you see fit.
textfield.layer.borderWidth = 1.0;
textfield.layer.borderColor = [UIColor grayColor].CGColor;


You can also set the border style to none and use a custom background image:

textfield.background = [UIImage imageNamed:@"bg.png"];
0

精彩评论

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