iphone - Dynamically insert more UITextFields -


I have been told in the attached screen shot. When the blue plus button is clicked, then there is a need to insert another UItextfield between the previous text fields and the textview and the blue-ed button, which appears near the dynamically-entered new eTextfield. Have to be. Can anyone suggest how to achieve this? I've put all the fields in the UIScrollview .

Enter image details here

Scroll view is not enabled :

Enter image details here

You can do this:

In i Outlet previousTextField which has been added for the first time. As the name suggests, it will store the latest word text field.

Find run - (IBAction) addTextField: (ID) sender {float x = previous text file.frame.orine.x; Float y = previoustextfiled.frame.origin.i + 50; // Meet the last textfield and add 10 or more to it. Float w = previousTextField.frame.size.width; Float H = Previoustextfiled.frame.height.height; CGRect frame = CGRectMake (X, Y, W, H); UITextField * textField = [[UITextField alloc] initWithFrame: frame]; TextField.placeholder = @ "Enter username or email"; TextField.borderStyle = UITextBorderStyleRoundedRect; TextField.font = [UIFont systemFontOfSize: 15]; TextField.autocorrectionType = UITextAutocorrectionTypeNo; TextField.keyboardType = UIKeyboardTypeDefault; TextField.returnKeyType = UIReturnKeyDone; TextField.clearButtonMode = UITextFieldViewModeWhile edit; [Self.view addSubview: textField]; PreviousTextField = text field; }

How to go with an idea / algorithm, the compiler is not checked

I talk, The location of the Kbd> + button is changing. I think you can do this :)

Edit: Adding the following to the above method

  There is an outlet for CGRTE framebuttons = CGRactMake (adbuten.fr.org.x, adbutton.frame.organ 50+, adbooten.frame size.width, adbooten.frame size.heit); [AddButton removeFromSuperview]; [AddButton setFrame: framebuttons]; [Self.view addSubview: addButton];    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -