Ale*_*ich 2 react-native react-native-flatlist
我想FlatList在页面底部呈现页脚,即使没有足够的内容来填充整个屏幕。
为了做到这一点,您需要看一下本机反应源。
这里有一个代码,显示内部添加页脚。如您所见,它包含了其他内容View,可以使用ListFooterComponentStyleprop 设置样式。出于某种原因在文档中未进行描述。
所以这是解决方案:
<FlatList
data={someData}
keyExtractor={item => item.id}
contentContainerStyle={{flexGrow: 1}}
ListFooterComponentStyle={{flex:1, justifyContent: 'flex-end'}}
ListFooterComponent={<Footer/>}
...
/>
Run Code Online (Sandbox Code Playgroud)
UPD:使用AtlasRider的评论更新答案。
| 归档时间: |
|
| 查看次数: |
262 次 |
| 最近记录: |