How to customize the UITextField?
How to Customize 开发者_如何学GoUITextField has show in the below picture
.
[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"];
精彩评论