我有一个面板,其中键盘总是打开,因为我不希望用户拒绝它。在该面板中,我有一个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}
我试图使用平面列表来显示数据库中的帖子,但是平面列表只占据了一半的屏幕,另外两个容器也占据了大约一半的屏幕,目前当我在平面列表上滚动时,帖子只是显示在屏幕的下半部分(不出所料),但我想要整个页面滚动,所以帖子可以在全屏上看到,这样它们更容易阅读。
这是我的布局的一个简化版本。
<View>
<View>
// some content
</View>
<View>
// some content
</View>
<FlatList
// posts displayed from a d
当TextInput被聚焦时,用户滚动直到输入离开可见的框架,输入变得模糊,键盘消失。我该如何解决这个问题? 我在Android模拟器中运行代码。在iOS上,这个问题不会发生。如果您尝试点击FlatList底部的TextInput,键盘会立即关闭,这可能是因为一旦键盘打开,输入内容就在键盘下方。任何线索都将不胜感激 下面是要重现的代码 import React from 'react';
import { TextInput, FlatList } from 'react-native';
export default class App extends R
我有一个父FlatList,在它的页脚中,它可以呈现另一个平面列表或简单的滚动视图。 const renderFooter1 = () => {
return <ScrollView> ... </ScrollView>;
}
const renderFooter2 = () => {
return <FlatList ... />;
}
// Note: I am not doing this in real life, just an example for handling both possible footers
re