У меня есть Три TextField
Для имени телефона и электронной почты.
При выборе каждого текстового поля появится клавиатура
-(void)createdTextField{
phoneField = [[UITextField alloc]initWithFrame:CGRectMake(225, 306, 90, 31)];
[phoneField setPlaceholder:REQUIRED];
[phoneField setBorderStyle:UITextBorderStyleRoundedRect];
phoneField.delegate = self;
phoneField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;
phoneField.keyboardType = UIKeyboardTypeNumberPad;
[phoneField setTag:10];
[self.view addSubview:phoneField];
[self.view addSubview:phoneField];
nextPhoneField = [[UITextField alloc]initWithFrame:CGRectMake(325, 306, 142, 31)];
[nextPhoneField setBorderStyle:UITextBorderStyleRoundedRect];
nextPhoneField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;
nextPhoneField.delegate = self;
nextPhoneField.keyboardType = UIKeyboardTypeNumberPad;
[nextPhoneField setTag:11];
[self.view addSubview:nextPhoneField];
nameField = [[UITextField alloc] initWithFrame:CGRectMake(225, 265, 242, 31)];
[nameField setPlaceholder:REQUIRED];
[nameField setBorderStyle:UITextBorderStyleRoundedRect];
nameField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;
// [nameField setAutocorrectionType:UITextAutocorrectionTypeNo];
[nameField setTag:12];
[self.view addSubview:nameField];
eMailField = [[UITextField alloc]initWithFrame:CGRectMake(225, 347, 242, 31)];
[eMailField setPlaceholder:REQUIRED];
[eMailField setBorderStyle:UITextBorderStyleRoundedRect];
eMailField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;
eMailField.keyboardType = UIKeyboardTypeEmailAddress;
[eMailField setAutocorrectionType:UITextAutocorrectionTypeNo];
[eMailField setTag:13];
[self.view addSubview:eMailField];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}
@ Когда нужно отклонить клавиатуру при наборе кнопки возврата во всех четырех текстовых полях Мне нужно убрать клавиатуру.
Это происходит только для телефона без оставшегося TextField.