代码之家  ›  专栏  ›  技术社区  ›  Return-1

避免将TextInput重点放在本地Android上

  •  0
  • Return-1  · 技术社区  · 6 年前

    以下代码在iOS上运行良好

    <TextInput pointerEvents={"none"} value={textValue2} onPress={something}></TextInput>

    但在安卓系统上 pointerEvents 不支持。

    TextInput TouchableOpacity

    editable={false} selectTextOnFocus={false}

    1 回复  |  直到 6 年前
        1
  •  4
  •   Sagar Bhatnagar    6 年前
    You can use Keyboard API.
    
    import { Keyboard, TextInput } from 'react-native';
    
    <TextInput
      onSubmitEditing={Keyboard.dismiss}
    />
    

    请参阅中的完整示例 react native offical document .