use*_*293 4 textinput scrollview android-edittext react-native react-native-scrollview
我在 ScrollView 中有一个 TextInput。
当 TextInput 处于焦点时,滚动不起作用。此问题仅影响 Android。
环境
<ScrollView keyboardShouldPersistTaps="always"
结合下面的 textInput 组件(我为文本输入创建的自定义组件以解决此问题)解决了我的问题:
<TouchableOpacity
activeOpacity={1}
onPress={()=>this.input.focus()}>
<View pointerEvents="none"
<TextInput
ref = {(input) => this.input = input}
/>
</View>
</TouchableOpacity>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12212 次 |
| 最近记录: |