내 iPhone 응용 프로그램에서. MFMailComposerView
보기에서 수신자를 클릭하면 키 보드가 나타납니다. 키보드에서 return 키를 클릭하면됩니다. 그러나 키보드는 사라지지 않습니다.mfmailcomposerview에서 키보드를 닫는 법
답변
다음 코드를 사용할 수 있습니다. 앱에서이를 사용하는 경우 UIWindow의 firstResponder 방법은 개인 API이기 때문에
UIWindow *mainWin = [[UIApplication sharedApplication] keyWindow];
UIView *responder = [mainWin performSelector:@selector(firstResponder)];
[responder resignFirstResponder];
하지만, 애플은 확실히 당신의 응용 프로그램을 거부합니다.는
참조 : SO
이 답변의 사본에 대한 atlist 링크를 넣어주십시오 : - http://stackoverflow.com/questions/4872565/mfmailcomposeviewcontroller-keyboard-issue –
사용 UIWindow
알림 키보드와 단지에 .. 표시합니다 MFMailComposerViewController
에 대한 울부 짖는 코드를 사용
- (IBAction)showMailController {
//Present mail controller on press of a button, set up notification of keyboard showing and hiding
[nc addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil];
[nc addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotification object:nil];
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
//... and so on
}
- (void)keyboardWillShow:(NSNotification *)note {
//Get view that's controlling the keyboard
UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow];
UIView* firstResponder = [keyWindow performSelector:@selector(firstResponder)];
//set up dimensions of dismiss keyboard button and animate it into view, parameters are based on landscape orientation, the keyboard's dimensions and this button's specific dimensions
CGRect t;
[[note.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue: &t];
button.frame = CGRectMake(324,(290-t.size.height),156,37);
button.alpha = 0.0;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[[[[[firstResponder superview] superview] superview] superview] addSubview:button];
button.alpha = 1.0;
button.frame = CGRectMake(324,(253-t.size.height),156,37);
[UIView commitAnimations];
}
- (IBAction)dismissKeyboardInMailView {
//this is what gets called when the dismiss keyboard button is pressed
UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow];
UIView* firstResponder = [keyWindow performSelector:@selector(firstResponder)];
[firstResponder resignFirstResponder];
}
- (void)keyboardWillHide:(NSNotification *)note {
//hide button here
[button removeFromSuperview];
}
내가이 링크에서이 코드의 일부를 가지고
..programmatically-align-a-toolbar-on-top-of-the-iphone-keyboard
@NitinGohel 위의 해고 코드는 어떨까요? 이 코드는 http://stackoverflow.com/questions/4872565/mfmailcompleviewcontroller-keyboard-issue에서 사용 된 코드와 완전히 동일합니다. –
- 1. 키보드를 닫는 방법?
- 2. keyListener로 jframe을 닫는 법
- 3. 프로그래밍 방식으로 키보드를 닫는 방법
- 4. 모달보기의 경우 키보드를 닫는 방법?
- 5. 텍스트 필드에서 키보드를 닫는 방법
- 6. 프래그먼트에서 소프트 키보드를 닫는 방법
- 7. 강제로 활동을 계속하는 법 앱을 닫는 법
- 8. 키보드를 Jquery/Javascript로 누르는 법
- 9. PyQt 앱을 깔끔하게 닫는 법
- 10. modalPresentationStyle을 사용할 때 iPad에서 키보드를 닫는 방법
- 11. 여러 텍스트 필드의 모든 키보드를 닫는 방법?
- 12. 회전 후 iPhone 6의 키보드를 닫는 방법
- 13. 키보드 버튼을 클릭하여 화면 키보드를 닫는 이벤트
- 14. 화면을 두드리는 방법으로 키보드를 닫는 방법
- 15. Windows 8 - 터치 키보드를 닫는 방법?
- 16. 프로그래밍 방식으로 키보드를 Monotouch에서 닫는 방법
- 17. UITableview에서 정의한 UITableview에서 키보드를 닫는 방법
- 18. Xcode UIScroll로 백그라운드 터치에서 키보드를 닫는 방법
- 19. 전체 앱에서 터치했을 때 키보드를 닫는 방법
- 20. navigationController에서 UIViewController를 누르기 전에 키보드를 닫는 방법
- 21. easockock에서 조롱 한 연결 객체를 닫는 법
- 22. 파이어 폭스에서 사이드 바를 닫는 법
- 23. 자바에서 그 자체의 인스턴스를 닫는 법
- 24. 자바 스크립트를 사용하여 키보드를 강제로 안드로이드 닫는 방법
- 25. iPhone SDK : 사용자가 새 필드로 이동할 때마다 키보드를 닫는 방법
- 26. Android : 명시 적으로 표시된 소프트 키보드를 닫는 방법?
- 27. 현재 EditText가 현재 활성화되어있는 모든 키보드를 일시적으로 닫는 방법
- 28. 10 자리 숫자 뒤에 숫자 키보드를 닫는 방법?
- 29. 가입자가 신속한 반응 코코아에서 오류를 throw하면 키보드를 닫는 방법?
- 30. 내 TextField가 포함 된 레이어를 닫는 동안 키보드를 숨기는 방법
아니요 키보드를 절대로 무시할 수 없습니다 –
일부 재귀 응답 체인 해킹으로 인해 iOS 6 이전 버전에서 작동하지만 메일 컨트롤러가 원격이므로 이제는 응답자를 원격으로 사칭하려고 시도 할 수는 없습니다. – CodaFi
나는 리턴 키가 한 텍스트 필드에서 MFMailComposerView의 다른 텍스트 필드로 이동한다고 생각한다. 마지막 텍스트 필드는 리턴한다. –