inputView 사용 후 키보드를 표시하는 방법
-
12-12-2019 - |
문제
나는 사용했다 inputView
보여주기 위해 uipickerview
나를 위해 textfield
, 하지만 나는 같은 것을 사용합니다 textfield
다른 기능을 위해.표준 키보드를 사용한 후 어떻게 표시합니까? inputView
그에 대한 textfield
?
textfield.inputView = pickrView;
해결책
그냥
textfield.inputView = nil;
나를 위해 일했습니다
다른 팁
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.35];
[yourTextField resignFirstResponder];
yourTextField.inputView = nil;
[yourTextField becomeFirstResponder];
[UIView commitAnimations];
.이 코드가 일할 수 있다고 생각합니다
[textField.inputView addTarget:self action:@selector(doTest) forControlEvents:UIControlEventTouchUpInside];
- (void)doTest
{
if([textFiled isFirstResponder])
{
[textFiled resignFirstResponder];
}
else
{
[textFiled becomeFirstResponder];
}
}
. 제휴하지 않습니다 StackOverflow