我有一个面板,其中键盘始终保持弹出状态,因为我不希望用户将其关闭。在这个面板中,我有一个类似于以下内容的 FlatList:
<KeyboardAvoidingView style={{ flex: 1 }}>
<FlatList
// This keeps the keyboard up and disables the user's ability to hide it.
keyboardShouldPersistTaps="handled"
data={this.state.examples}
keyExtractor={(item, index) => index.toString()}
renderItem={this._renderItem}
contentContainerStyle={{ flex: 1}}
/>
</KeyboardAvoidingView>
到目前为止,我已经实现了我想要的。然而,当键盘弹出时 - 它会隐藏FlatList渲染的底部一部分项目。用户无法向上滚动并查看最后的项目,因为它们停留在键盘后面。
如何保持键盘打开状态(并禁用取消功能),同时能够查看和滚动整个FlatList内容?