【发布时间】:2020-07-22 10:14:30
【问题描述】:
我不明白为什么我的 FlatList 在底部包含一个空格,如下所示: that's the space
谁能帮我删除空间?我尝试了很多方法,但没有一个有效。我也尝试使用 ScrollView 但出现同样的问题。这是我的源代码:
<View
style={{
flex: 1,
backgroundColor: 'red',
justifyContent: 'center',
alignItems: 'center',
}}>
<FlatList
data={eventCategories}
initialNumToRender={5}
keyExtractor={item => item.id_event_category}
showsHorizontalScrollIndicator={false}
horizontal
renderItem={renderCategories}
/>
<View>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
<Text>Halo</Text>
</View>
<View style={styles.button}>
<SmallButton
title="Urutkan"
icon="sort-active"
onPress={() => setVisibleSort(true)}
/>
</View>
</View>
asa
【问题讨论】:
-
尝试从父
view移除 flex:1 -
你能分享一下renderCategories代码吗?
标签: reactjs react-native scrollview react-native-flatlist