I. Common settings for TextFieldCreate text box Uitextfield *TF = [[Uitextfield alloc] Initwithframe:cgrectmake (60, 100, 200, 40)];1. Set the border style of the text box (typically rounded style)BorderStyle2. Set the keyboard(Choosing the right keyboard helps you to enter it as you intended.) When entering the password, select the numeric keypad. When the user registers, select the letter keyboard) Keyboardtype3. Set the Purge button(Selection mode: what happens) Clearbuttonmode4. Set the ciphertext input(Cannot enter Chinese, for password input) securetextentry5. Set return button style(commonly set to: Next,done,go,search,send) Returnkeytype6. Set the left and right view of the text box(The general left view is used for hints, such as placing a lock on a style picture prompting the user to be a password text box.) The right-hand view can be used to modify the text input or send verification code. )//Set text box left view: invalid x, y value, default = 0,0
Picture view
Uiimageview *iv = [[Uiimageview alloc] Initwithframe:cgrectmake (10, 10, 30, 30)];
Set picture of picture View iv.image = [UIImage imagenamed:@ "account"]; Tf.leftview = IV; Sets the case for displaying the left view Tf.leftviewmode = Uitextfieldviewmodealways;7. Set the input view of the text box (generally not used, when you need some advanced keyboard features.) )Set the input view for the text box: X,y,w Invalid default is (0, screen height-Enter the height of the view itself, screen width, h)
UIView *view = [[UIView alloc] Initwithframe:cgrectmake (0, 0, 100, 216)]; View.backgroundcolor = [Uicolor Orangecolor]; Tf.inputview = view; Set the text box input view's satellite view (Level two view): X,y,w Invalid
UIView *accessoryview = [[UIView alloc] Initwithframe:cgrectmake (0, 0, 100, 44)]; Accessoryview.backgroundcolor = [Uicolor Bluecolor]; Tf.inputaccessoryview = Accessoryview;
ios-uitextfield-Basic Knowledge