私は2つのテキストフィールドを持つアプリを持っています。今私の問題は、最初のユーザーが通常のテキストフィールドをタップすると言う。キーボードをポップアップ表示します。終了ボタンを選択せずに、日付フィールドをタップします。アクションシートがポップアップ表示されます(キーボードを外すことなく)。アクションシートを隠した後、ユーザーは他のテキストフィールドをタップし、キーボードのリターンキーをクリックしなければなりません。アクションシートがポップアップする場合はキーボードを隠す
アクションシートがポップアップする場合は、キーボードを非表示にしたいですか?
私のコードは、あなたがUITextFieldDelegate
プロトコルメソッド- (void)textFieldDidEndEditing:(UITextField *)textField
を実装しようとしたことがあり
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
if([textField isEqual:txtdob])
{
[textField resignFirstResponder];
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
// txtdob.inputView=actionSheet;
CGRect pickerFrame = CGRectMake(0, 40, 0, 0);
datepicker=[[UIDatePicker alloc] initWithFrame:pickerFrame];
datepicker.datePickerMode = UIDatePickerModeDate;
//[datepicker setMinimumDate:minDate];
[datepicker addTarget:self action:@selector(changeDateInLabel:) forControlEvents:UIControlEventValueChanged];
[actionSheet addSubview:datepicker];
[datepicker release];
UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]];
closeButton.momentary = YES;
closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
closeButton.tintColor = [UIColor blueColor];
[closeButton addTarget:self action:@selector(dismissActionSheet) forControlEvents:UIControlEventValueChanged];
[actionSheet addSubview:closeButton];
[closeButton release];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0, 0, 320, 485)];
}
}
申し訳ありませんインチ –