Uitwxtfield (input box): A control that is available in iOS to display text and edit text.
Core Features: Text editing
1. Create an input Box object
Uitextfield *TF = [[Uitextfield alloc] Initwithframe:cgrectmake (30, 100, 300, 40)];
2. Configuring related properties
Tf.backgroundcolor = [Uicolor Yellowcolor];
2.1 Setting prompt text (VIP)
Tf.placeholder = @ "Please enter your measurements";
2.2 Setting input Box contents (VIP)
Tf.text = @ "38";
2.3 Setting the text color
Tf.textcolor = [Uicolor Redcolor];
2.4 Set Text alignment-center alignment
Tf.textalignment = Nstextalignmentcenter;
2.5 Setting the font size
Tf.font = [Uifont boldsystemfontofsize:25];
2.6 Clears the contents of the input box when the input box is selected for the first time.
tf.clearsonbeginediting = YES;
2.7 Set Clear button mode
Tf.clearbuttonmode = uitextfieldviewmodewhileediting;
2.8 Setting the Input box style
Tf.borderstyle = Uitextborderstyleroundedrect;
2.9 Setting the input box can edit--Turn off user interaction (NO)
tf.userinteractionenabled = YES;
2.10 Setting the keyboard type--numeric keypad
Tf.keyboardtype = Uikeyboardtypenumberpad;
2.11 Setting the keyboard appearance style
Tf.keyboardappearance = Uikeyboardappearancedark;
2.12 Setting the input box contents to display in Safe mode
Tf.securetextentry = YES;
2.13 Agent (detects various behavior of input box) (VIP)
Tf.delegate = self;//Proxy specified as Appdelegate object
3. Add to Parent View
[Self.window ADDSUBVIEW:TF];
4. Release of ownership
[TF release];
Uitextfield Learning Knowledge points