我有TableView。在每一行,我有文本框,三個文本框有UIPickerView,兩個是可編輯的,問題是,當我敲擊可編輯的文本框鍵盤上後選擇器的文本框挖掘不到風度這裏消失是代碼鍵盤不會消失時攻絲UIPickerView
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
tf_Selected = (UITextField*)textField;
if ([textField.placeholder isEqualToString:@"Work Order "]) {
if (dicWorkOrderNoData.count > 0)
{
[ActionSheetStringPicker showPickerWithTitle:@"Select Work Order" rows:[dicWorkOrderNoData allValues] initialSelection:0 target:self successAction:@selector(selectPicker_ActionHandler:) cancelAction:@selector(cancelSheet_ActionHandler) origin:textField];
}
else if (textField.tag == DateField_UptoCurrentDate)
{
[ActionSheetDatePicker showPickerWithTitle:@"Select Date" datePickerMode:UIDatePickerModeDate selectedDate:[NSDate date] maximumDate:[NSDate date] target:self action:@selector(selectDate_ActionHandler:) cancel:@selector(cancelSheet_ActionHandler) origin:textField];
return NO;
}
else
{
return YES;
}
}
使用:[textField resignFirstResponder]; – parilogic