전체 화면을 가져 오는 10 개의 UITextField가 있습니다. 내가 그들을 바꿀 때, 화면 절반에 키패드가 생기므로, 나는 숨겨진 필드를 바꿀 수 없다. 솔루션을 아는 사람이 있습니까?키패드가 숨어 있습니다. UITextField
0
A
답변
1
키보드를 불러 와서 프레임을 위로 올려야합니다.
- (void)keyboardWillShow:(NSNotification *)aNotification
{
self.frame = CGRectMake(0,-[size of keyboard],self.frame.size.width,self.frame.size.height);
}
0
- (void)textFieldDidBeginEditing:(UITextField *)textField {
if (textField == textField1) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield1.frame = CGRectMake(textfield1.frame.origin.x, (textfield1.frame.origin.y - 100.0), textfield1.frame.size.width, textfield1.frame.size.height);
[UIView commitAnimations];
} else if (textField == textField2) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield2.frame = CGRectMake(textfield2.frame.origin.x, (textfield2.frame.origin.y - 100.0), textfield2.frame.size.width, textfield2.frame.size.height);
[UIView commitAnimations];
}
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
if (textField == textField1) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield1.frame = CGRectMake(textfield1.frame.origin.x, (textfield1.frame.origin.y + 100.0), textfield1.frame.size.width, textfield1.frame.size.height);
[UIView commitAnimations];
} else if (textField == textField2) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield2.frame = CGRectMake(textfield2.frame.origin.x, (textfield2.frame.origin.y + 100.0), textfield2.frame.size.width, textfield2.frame.size.height);
[UIView commitAnimations];
}
터치에
:- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{[텍스트 필드 resignFirstResponder]; }
희망이 도움이 될 것입니다.
도와 드리겠습니다.
관련 문제
- 1. mysql 간단한 구문 오류가 내게 숨어 있습니다.
- 2. 확인 키패드가 AT-명령
- 3. 키패드가 표시되지 않습니다
- 4. 키패드가 텍스트보기를 숨 깁니다.
- 5. popViewControllerAnimated 후 UITextField 내용이 비어 있습니다.
- 6. TableView 셀에 UITextField 표시 문제가 있습니다.
- 7. 숨어 이전 입력 버튼
- 8. 숨어 키보드 문제
- 9. UIButton이 작동하지 않습니다. 첫 번째 응답자가 아니거나보기 뒤에 숨어 있습니다.
- 10. 왜 숨어 있지 않은가?
- 11. Haskell Prelude 숨어, UNDO?
- 12. 숨어 창 명령 줄
- 13. 숨어 파이썬 코드
- 14. 키보드 뒤에 숨어있는 UITextField
- 15. 이 공백은 어디에 숨어 있습니까?
- 16. NotifyIcon이 (가) 사라집니다. 숨어 있습니까?
- 17. JQuery 탭이 숨어 있지 않습니다.
- 18. SlidingDrawer가 Scrollview 뒤에 숨어 있음
- 19. Win32 프로그래밍 숨어 콘솔 창
- 20. SystemTray가 자동으로 숨어 나오지 않도록하기
- 21. 스티커 바닥 글 숨어 내용
- 22. UiTextField 이벤트
- 23. Validate UITextField
- 24. UITextField resignFirstResponder
- 25. 수신자에게 UITextField
- 26. UITableViewCell의 UITextField
- 27. UITextField autocomplete
- 28. UITextField 포커스
- 29. 아이폰의 UITextField
- 30. UITextField sublayer
텍스트 필드를 스크롤 할 수 있으며 텍스트 필드를 클릭 할 때마다 키보드가 나타납니다. – rishi