React本机平面列表中的最后一项超出了屏幕

问题描述 投票:2回答:1

我在外部容器上具有一些样式的清单,如下。

<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>

问题在于,列表的最后一个值超出了屏幕的视图范围,除非在父容器上放置了固定的高度,否则无法查看列表。可以在没有固定高度的情况下进行此操作。

image-of-problem

react-native react-native-flatlist react-native-stylesheet
1个回答
0
投票
更多示例可在react native docs中找到。
© www.soinside.com 2019 - 2024. All rights reserved.