简体   繁体   English

文本输入中的Android三星设备上的React-native键盘没有逗号

[英]React-native keyboard no comma on android Samsung devices in Text Input

I have a React-native app with TextInput and KeyboardAvoidingView .我有一个带有TextInputKeyboardAvoidingViewReact-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.

相关问题 少数Android设备中的键盘覆盖输入文本对本机博览会应用程序做出反应 - keyboard overplay input text in few android devices react native expo app 没有点和逗号的 React-Native TextInput 数字键盘 - React-Native TextInput numeric keyboard without dot and comma React Native 55.4:contextMenuHidden 不会在 Android 上隐藏菜单 - 禁用 React-Native 文本输入选项 - React Native 55.4: contextMenuHidden does not hide menu on Android - Disable Options on React-Native Text Input 逗号不适用于三星 Android 键盘 - Comma doesnt work on Samsung Android Keyboard 键盘在Android应用中显示一半在三星设备上 - Keyboard showing half on samsung devices in android app React-Native 图像渲染在不同的 android 设备上基于他们的 DPI - React-Native Image rendering on different android devices based on their DPI 在某些Android设备上未安装React-Native“应用” - React-Native “app is not installed” on some Android devices react-native android bundle release 无法在某些设备上运行 - react-native android bundle release fails to run on some devices react-native 中的键盘隐藏 - Keyboard Hiding in react-native Android上的react-native中键盘的精确高度(带有自动更正) - Exact height of keyboard (with autoCorrect) in react-native on Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM