问题
Following this question on fixed footer with a ScrollView, I'm trying to implement a fixed footer on the screen with a FlatList. I have tried to use the answer provided by putting the flat list inside a view, but then none of the items are rendered. Does any one know how to implement a fixed footer with a flat list as the other main element of component?
回答1:
Using this flex solution I managed to do it with a couple of nested Views:
<View style={{flex: 1}}>
<View style={{flex: 0.9}}>
<FlatList/>
</View>
<View style={{flex: 0.1}}/>
</View>
回答2:
FlatList comes with footer support in the form of ListFooterComponent
Try adding something like this to your flatlist
ListFooterComponent={() => <Text>Footer content</Text>}
Hope this helps!
来源:https://stackoverflow.com/questions/49224471/fixed-footer-in-react-native-with-flatlist