创建一个布局,其中一个部分是静态的,其他部分在 Native-Base 中滑动时可滚动

Create a layout where one part is static and other is scrollable on swipe in Native-Base

我的应用程序上有一个选项卡屏幕,我希望将其布局分成两部分。 1) 将是静态的顶部容器,无论您是否滑动up/down。它还包含 Native-Base 选项卡。

2) 每个选项卡都会有一个 FlatList 或 ScrollView 我想让它在滑动时滚动?

这是基本思路:

现在,似乎 Native-Base "Container" 组件添加了这种可滚动行为,当我从 Container 更改为 View 时,我的屏幕当然发生了变化,但至少它是不可滚动的根本。但是标签没有显示,完全是空的。

如何实现这种布局?

这是我当前的布局框架:

<Container>
  <Header>
     ... some header title and icon, doesn't matter ...
  </Header>
  <Content>
     <View>
        <Tabs>
           <Tab heading={ TabHeading here }>
              <ScrollView>
                  <Text>Some Content Here</Text>
              </ScrollView>
           </Tab>
           <Tab heading={ TabHeading here }>
              <ScrollView>
                  <Text>Some Content Here</Text>
              </ScrollView>
           </Tab>
           <Tab heading={ TabHeading here }>
              <ScrollView>
                  <Text>Some Content Here</Text>
              </ScrollView>
           </Tab>
        </Tabs>
     </View>
  </Content>
</Container>

实际上是 Content 组件引起了滚动,因为它被包裹在 react-native-keyboard-aware-scroll-view https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Content.js

要禁用 Content 上的滚动,您只需将 false 传递给 scrollEnabled 属性

<Content scrollEnabled={false}>
  ...
</Content>

这应该会停止顶部的滚动。