更新时间:2023-02-03 09:34:36
获取 keyboardType
在InputView Delegate方法而不是ViewDidLoad中。因为在键盘完全呈现并且输入对象被激活之前你无法获得keyboardType。
Get the keyboardType
in InputView Delegate Methods Instead of ViewDidLoad . Because you can't get the keyboardType until The keyboard is fully presented and the input object is activated .
- (void)textWillChange:(id<UITextInput>)textInput {
NSLog(@"TextInputMode: %ld", self.textDocumentProxy.keyboardType);
}
OR
- (void)textDidChange:(id<UITextInput>)textInput {
NSLog(@"TextInputMode: %ld", self.textDocumentProxy.keyboardType);
}