user891268
user891268

Reputation: 1425

How to customize the UITextField?

How to Customize UITextField has show in the below picture

.enter image description here

Upvotes: 1

Views: 489

Answers (4)

mjisrawi
mjisrawi

Reputation: 7936

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

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

Upvotes: 0

Akshay
Akshay

Reputation: 5765

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

Upvotes: 1

futureelite7
futureelite7

Reputation: 11502

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;

Upvotes: 0

Nekto
Nekto

Reputation: 17877

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

Upvotes: 0

Related Questions