我有一个带有出口 btnAdd 的按钮操作,当它按下它时添加文本字段,我想将按钮操作也移动到文本字段下方,并且同样希望在按下按钮 BtnRemove 时恢复,
- (IBAction)btnAddTxtField:(id)sender {
textField = [[UITextField alloc] initWithFrame:CGRectMake(76, ([txtFieldArray count] * 30), 191, 25)];
[textField setBorderStyle:UITextBorderStyleLine];
textField.font = [UIFont systemFontOfSize:20];
textField.placeholder = @"Enter text";
textField.autocorrectionType = UITextAutocorrectionTypeNo;
textField.keyboardType = UIKeyboardTypeDefault;
textField.returnKeyType = UIReturnKeyDone;
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
textField.delegate = self;
[myScrollview addSubview:textField];
[txtFieldArray addObject:textField];
CGRect frame = bottomView.frame;
frame.origin.y += textField.frame.size.height + 5;
btnAdd = [[UIButton alloc] initWithFrame:CGRectMake(210, ([txtFieldArray count] *30), 20, 20)];
frame.origin.y += btnAdd.frame.size.height +5;
bottomView.frame = frame;
textField.hidden = NO;
}