【发布时间】:2020-12-28 10:32:56
【问题描述】:
我在react-native 中有一个text-input,我想在输入字段上应用我的自定义键盘并将软键盘隐藏在焦点上。我尝试将showSoftInputOnFocus 设置为false,但此道具仅在Android 上可用。我怎样才能做到这一点?
我的textinput 看起来像这样
<Text style={styles.symbol}>$</Text>
<TextInput
onFocus={() => onFocus('salesPrice')}
value={tabDetails.salesPrice}
onChangeText={value => onStateChange('salesPrice', value)}
placeholderTextColor={colors.placeholderColor}
placeholder={constants.common.zeroPlaceholder}
showSoftInputOnFocus={false}
style={styles.textInput}
onEndEditing={event =>
onEndEditing('salesPrice', event.nativeEvent.text)
}
/>
【问题讨论】: