【问题标题】:Last item of FlatList trimmed from bottom从底部修剪的 FlatList 的最后一项
【发布时间】:2020-05-26 04:04:30
【问题描述】:

我正在显示一个包含可变数量项目的 FlatList,并且最后一个项目始终不完全可见(边框底部)。

渲染()

render() {
    return (
      <View style={styles.container}>
        <FlatList style={styles.list} containContainerStyle={{paddingBottom: 20}}
          ...
        />
      </View>
    );
  }

CSS

container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'white'
  },
list: {
   flex: 1,
   width: "95%"
}

【问题讨论】:

    标签: css reactjs react-native styling react-native-flatlist


    【解决方案1】:

    您为平面列表使用了错误的样式属性,它是 contentContainerStyle 而不是 containsContainerStyle。您必须根据物品的大小增加它。

    <FlatList contentContainerStyle={{ paddingBottom: 20}} />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-14
      • 1970-01-01
      • 1970-01-01
      • 2014-03-11
      • 1970-01-01
      • 2011-09-19
      • 2019-10-24
      • 1970-01-01
      相关资源
      最近更新 更多