[英]React-native keyboard no comma on android Samsung devices in Text Input
I have a React-native
app with TextInput
and KeyboardAvoidingView
.我有一个带有
TextInput
和KeyboardAvoidingView
的React-native
应用程序。 And everywhere it works well except android Samsung devices, especially Samsung A3.除了安卓三星设备,尤其是三星 A3,它在任何地方都运行良好。 Because on this device the keyboard is appearing without a comma, but I need to use it on the screen.
因为在这个设备上,键盘没有逗号,但我需要在屏幕上使用它。
I already tried the steps from this article , removed autoCapitalize="none"
from the TextInput
component, but it is not working for me.我已经尝试了本文中的步骤,从
TextInput
组件中删除了autoCapitalize="none"
,但它对我不起作用。
Can somebody recommend how can I solve it please.[有人可以推荐我如何解决它。[
<TextInput
style={textInput}
placeholder={props.placeholder}
underlineColorAndroid='transparent' editable={!props.disabled}
keyboardType={keyboardType}
autoCorrect={false} selection={state.position}
value={state.value} onChangeText={this._onChangeText}
onFocus={this._onFocus} onBlur={this._onBlur}
autoFocus={autoFocus}
/>
How about using怎么用
keyboardType = {'numbers-and-punctuation'}
in textInput keyboardType = {'numbers-and-punctuation'}
在 textInput
This is yout text Input这是你的文本输入
const alphaNumericRegex = /^[a-zA-Z0-9]*$/;
<TextInput
ref={ref => (this.panNumber = ref)}
onChangeText={val => this.checkAlphaNumeric(val)}
value={this.state.panNumber}/>
checkAlphaNumeric = ( value) => {
if (!alphaNumericRegex.test(value)) {
if (this.state.panNumber.length == 1) {
this.setState({ [panNumber]: "" });
}
Toast.show({
text: "Only alphabets and digits are allowed.",
position: "top"
});
} else {
this.setState({ panNumber: value });
}
};
在工作期间,我发现这个错误是一个软件问题的信息,它主要存在于带有 API 5.0 的旧 Android 型号上,这是使用 Google 键盘解决此错误的最佳解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.