gpt4 book ai didi

呈现键盘时 react native 单击按钮

转载 作者:行者123 更新时间:2023-12-05 04:50:27 27 4
gpt4 key购买 nike

我有几个输入字段,它们使用代表每个输入的 flatlist 和 smartView 一个接一个地呈现,结构如下:

    <View>
<Dialog>
<View >
<KeyboardAvoidingView>
<FlatList
renderItem={({ item }) => (
<SmartView //structure of view per input
<SafeAreaView>
<View>
<InputItem/>
<TouchableNativeFeedback/> //button that must be clicked
</View>
</SafeAreaView>
/>
)}>
</KeyboardAvoidingView>
</View>
</Dialog>
</View >

类(class)<InputItem/>包含 <TextInput>有问题和<TouchableNativeFeedback/><InputItem/>处于同一级别

我只需要按钮在显示键盘时注册一次点击,因为这个应用程序在 iPad 上运行并且键盘不会以任何方式出现。非常感谢

最佳答案

通过添加 keyboardShouldPersistTaps={"always"} 解决了问题到组件 <Dialog> .

关于呈现键盘时 react native 单击按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67265447/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com