簡體   English   中英

如何在 React Native 中滾動到末尾時將按鈕保留在平面列表的底部?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM