Saturday, March 23, 2013

Add UITextField Programmatically


CGRect textFieldFrame = CGRectMake(0.00.0100.030.0);
UITextField *txtField = [[UITextField allocinitWithFrame:textFieldFrame];
// default is UITextBorderStyleNone. If set to UITextBorderStyleRoundedRect, custom background images are ignored.

[txtField setBorderStyle:UITextBorderStyleRoundedRect];
[txtField setTextColor:[UIColor blackColor]];
[txtField setFont:[UIFont systemFontOfSize:20]];
[txtField setDelegate:self];
[txtField setPlaceholder:@"Add Your Placeholder Text Here"];
[txtField setBackgroundColor:[UIColor whiteColor]];
txtField.keyboardType = UIKeyboardTypeDefault;


http://ios.biomsoft.com/tag/uitextfield/

No comments:

Post a Comment