[英]How to keep button at the bottom of flatlist while scrolling to the end in React Native?
const Screen = () => {
return (
<View style={styles.container}>
<Text style={styles.heading}>Screen Data</Text>
<View>
<FlatList
data={data}
renderItem={({item}) => (
<View>
<Text style={styles.title}>{item.title}</Text>
<Text style={styles.description}>{item.description}</Text>
</View>
)}
ListFooterComponent={() => <Buttons text={''} onPress={undefined} />}
/>
</View>
</View>
);
};
export default Screen;
我创建了一个 Button 组件,它始终位于可滚动的平面列表的末尾,但它会重叠,我希望它保留在内容的末尾。
列表页脚组件是因为它可以是任何组件,请查看文档https://reactnative.dev/docs/flatlist#listfootercomponent 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.