我在外部容器上具有一些样式的清单,如下。
<View style={containerStyle}>
// more jsx components come here
<View style={resultContainerStyle}>
<FlatList
data={results}
keyExtractor={(item) => (item.id && item.id.toString())}
renderItem={({ item, index }) => (
<ListItem
item={item}
selectItem={selectItem}
/>
)}
/>
</View>
</View>
问题在于,列表的最后一个值超出了屏幕的视图范围,除非在父容器上放置了固定的高度,否则无法查看列表。可以在没有固定高度的情况下进行此操作。