Created
March 10, 2013 02:02
-
-
Save romyilano/5126762 to your computer and use it in GitHub Desktop.
Programmatically created UITextField
nice and easy!
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uitextfield-uitextfielddelegate/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CGRect passwordTextFieldFrame = CGRectMake(20.0f, 100.0f, 280.0f, 31.0f); | |
| UITextField *passwordTextField = [[UITextField alloc] initWithFrame:passwordTextFieldFrame]; | |
| passwordTextField.placeholder = @"Password"; | |
| passwordTextField.backgroundColor = [UIColor whiteColor]; | |
| passwordTextField.textColor = [UIColor blackColor]; | |
| passwordTextField.font = [UIFont systemFontOfSize:14.0f]; | |
| passwordTextField.borderStyle = UITextBorderStyleRoundedRect; | |
| passwordTextField.clearButtonMode = UITextFieldViewModeWhileEditing; | |
| passwordTextField.returnKeyType = UIReturnKeyDone; | |
| passwordTextField.textAlignment = UITextAlignmentLeft; | |
| passwordTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; | |
| passwordTextField.tag = 2; | |
| passwordTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; | |
| [self.view addSubview:passwordTextField]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment