UITextField
하위 클래스를 사용하여 사용자 지정 글꼴을 사용하고 있습니다. 그 자리 표시자를 textfield
으로 설정하면 약간 위로 이동하지만 텍스트 입력을 시작할 때 텍스트의 frame
에는 아무런 문제가 없습니다. 자리 표시 자 이동 문제를 해결할 수있는 방법이 있습니까?서브 클래 싱시 UITextField 자리 표시 자 이동
0
A
답변
1
self.txtFirstName.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
self.txtFirstName.autocapitalizationType = UITextAutocapitalizationTypeSentences;
self.txtFirstName.placeholder = @"Enter First Name here";
self.txtFirstName.textAlignment = UITextAlignmentLeft;
0
동일한 문제가있어서 setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter
을 시도하여 문제를 해결했습니다.
UITextField *txtPassword = [[UITextField alloc] initWithFrame:CGRectMake(15,55, 255, 25)];
[txtPassword setPlaceholder:@"Password..."];
[txtPassword setBackgroundColor:[UIColor whiteColor]];
[txtPassword setFont:[UIFont fontWithName:@"Helvetica" size:15]];
[txtPassword setSecureTextEntry:YES];
[txtPassword setTextAlignment:NSTextAlignmentCenter];
[txtPassword setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
[txtPassword becomeFirstResponder];
희망이 있습니다.
관련 문제
- 1. UITextField 자리 표시 자
- 2. UITextField 자리 표시 자 바꾸기
- 3. cellForRowAtIndexPath의 셀에 UITextField 자리 표시 자 설정
- 4. UITextField 자리 표시 자 텍스트 오버레이 문제
- 5. UITextfield 암호 자리 표시 자 도트
- 6. pandas.Index 서브 클래 싱시 "최대 재귀 깊이 초과"
- 7. 응용 프로그램 : didFinishLaunchingWithOptions : RBAppDelegate 서브 클래 싱시 실행되지 않음
- 8. 신속 서브 클래 싱 UITextField 문제
- 9. UITextField 포커스가있는 동안 자리 표시 자 텍스트를 유지하십시오.
- 10. UITextField 자리 표시 자 글꼴 색 흰색 iOS 5?
- 11. 자리 표시 자 텍스트의 텍스트 색 설정 UITextfield Apple TV
- 12. UITextField 자리 표시 자 텍스트의 크기가 감소하는 이유는 무엇입니까?
- 13. iOS6에서 자리 표시 자 텍스트를 무시하는 방법 UITextField
- 14. ino_t의 자리 표시 자
- 15. IE의 자리 표시 자
- 16. HTML 자리 표시 자
- 17. 자리 표시 자
- 18. 빈 자리 표시 자?
- 19. 데이터 자리 표시 자
- 20. 장고 자리 표시 자
- 21. SVG 자리 표시 자
- 22. PMySQL의 자리 표시 자
- 23. ContentEditable 자리 표시 자
- 24. QTableWidget의 자리 표시 자
- 25. 자리 표시 자 함수
- 26. 장고 자리 표시 자
- 27. 자리 표시 자 HTML5가
- 28. 자리 표시 자
- 29. 표시 자리 표시 자 텍스트
- 30. UITextField 자리 표시 자의 글꼴 크기가 다릅니다
다음을 참조하십시오. http://stackoverflow.com/questions/1340224/iphone-uitextfield-change-placeholder-text-color & http://stackoverflow.com/questions/11539404/centering-placeholder-text-in- subclass-of-uitextfield – Vishal