작동하지 않습니다textField.clearButtonMode =/* 어떤 */I가 TextField를 생성하고이 같은 뷰에 추가 해요
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(/*blah blah */)];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.clearButtonMode = UITextFieldViewModeAlways;
[otherView addSubview:textField];
otherView
에서 예상대로 텍스트 필드를 렌더링
하지만, ClearButton에 할당 한 값에 관계없이 Clear 버튼이 렌더링되지 않습니다. 아무도이 원인이 무엇인지 압니까?
텍스트를 입력 할 때 clearButton이 보이십니까? – Felix
ihavetoenter15 : 아니요 –
사실, 방금 다시 확인했는데 잘못되었습니다. 텍스트 필드에 값이 있으면 버튼이 있습니다. 나는 항상 "항상"이라는 의미는 ".text! = nil' 일 때"항상 "을 의미한다고 생각합니다. –