【问题标题】:place the footer at the bottom of a react native Drawer将页脚放在反应原生抽屉的底部
【发布时间】:2021-09-01 13:42:19
【问题描述】:

我尝试了多种方法来尝试将页脚定位在抽屉的底部... 如果有人知道,请告诉我,想法是将带有页脚文本的组件放在下部(图片)

我没有把应用程序的代码放在我的,但是我放了一些 react native 和一个添加的视图,这是一个想要放在底部的视图

https://snack.expo.io/@monsadiego/ask-footer-reactnative

要放置在底部的组件:

   <Text>
        This text in the footer ...
        </Text>
        </View>

【问题讨论】:

    标签: javascript css reactjs react-native jsx


    【解决方案1】:

    您可以将contentContainerStyle={{ flex: 1 }} 添加到DrawerContentScrollView 组件,然后在您的页脚顶部添加&lt;View style={{ flex: 1 }} /&gt;

    function CustomDrawerContent(props) {
      return (
        <DrawerContentScrollView {...props} contentContainerStyle={{ flex: 1 }}>
          <DrawerItemList {...props} />
          <DrawerItem label="Help" onPress={() => alert('Link to help')} />
          {/* Add this View */}
          <View style={{ flex: 1 }} />
          <View>
            <Text>This text in the footer ...</Text>
          </View>
        </DrawerContentScrollView>
      );
    }
    

    【讨论】:

      猜你喜欢
      • 2021-02-12
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多