"[sender resignFirstResponder]"메서드가 호출되지 않았지만 완료 버튼을 누르면 키보드가 여전히 닫힙니다. 완료 될 때까지 열려 있어야합니다. 어떻게이 일을 할 수 있습니까?iOS UITextField 화면에 키보드가 나타나지 않습니다.
가 여기에 키보드를 제어하는 내 행동의 :의 ...
- (IBAction)returnKeyButton:(id)sender {
BOOL guessCorrect = [gameModel checkGuess:guessTextField.text];
guessTextField.text = @"";
if (guessCorrect) {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"rightAnswer", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
if (gameModel.score == 10) {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"win", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
[self endGameWithMessage:@"You win!"];
} else {
scrambledWord.text = [gameModel getScrambledWord];
}
}
remainingTime.text = [NSString stringWithFormat:@"%i", gameModel.time];
playerScore.text = [NSString stringWithFormat:@"%i", gameModel.score];
}
내가 궁금 봐 ... 왜? – citruspi
요점은, 당신은 그 문제에 대한 해답을 추측합니다. 현재 로선 'return'키를 사용하여 대답을 추측 할 수 있지만 키를 누를 때마다 키보드가 닫힙니다. 답변을 입력 할 때마다 텍스트 필드를 다시 눌러야한다는 것은 짜증나게합니다. –
잠시만 기다려주세요 ... 나는 생각이 있습니다. :) – citruspi