有人如何停止 NativeBase 的 Tab 组件的水平滚动
How can someone stop horizontal scrolling of Tab Component of NativeBase
RN:我正在使用原生基础的选项卡组件。我想停止水平滚动的选项卡栏组件,因为我计划在此选项卡栏组件的第一个选项卡中有一些可水平滚动的视图。我只希望当用户向右或向左拖动直到他触摸图标 itself.I 时,标签不会更改 itself.I 我无法找到这样的道具,借助它我可以阻止它。希望你能理解。在这里,我想阻止这一切。
这是代码。
render() {
return (
<Container>
<Tabs renderTabBar={() => <ScrollableTab style={{ backgroundColor: '#4169E1' }} />} >
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }}>
<Icon name="home" style={{ color: 'white' }} />
</TabHeading>}>
<Text> This is Home </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="ios-search" style={{ color: 'white' }} />
</TabHeading>}>
<Text> This is Search </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<SimpleLineIcons name='user' color='white' size={25} style={{ marginLeft: 20 }} />
</TabHeading>}>
<Text> THis is User </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="help" style={{ color: 'white' }} />
</TabHeading>}>
<Texy> </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="cog" style={{ color: 'white' }} />
</TabHeading>}>
<Settings />
</Tab>
</Tabs>
</Container>
试试这个:
<Tabs locked />
RN:我正在使用原生基础的选项卡组件。我想停止水平滚动的选项卡栏组件,因为我计划在此选项卡栏组件的第一个选项卡中有一些可水平滚动的视图。我只希望当用户向右或向左拖动直到他触摸图标 itself.I 时,标签不会更改 itself.I 我无法找到这样的道具,借助它我可以阻止它。希望你能理解。在这里,我想阻止这一切。
这是代码。
render() {
return (
<Container>
<Tabs renderTabBar={() => <ScrollableTab style={{ backgroundColor: '#4169E1' }} />} >
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }}>
<Icon name="home" style={{ color: 'white' }} />
</TabHeading>}>
<Text> This is Home </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="ios-search" style={{ color: 'white' }} />
</TabHeading>}>
<Text> This is Search </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<SimpleLineIcons name='user' color='white' size={25} style={{ marginLeft: 20 }} />
</TabHeading>}>
<Text> THis is User </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="help" style={{ color: 'white' }} />
</TabHeading>}>
<Texy> </Text>
</Tab>
<Tab
heading={<TabHeading style={{ backgroundColor: '#4169E1' }} >
<Icon name="cog" style={{ color: 'white' }} />
</TabHeading>}>
<Settings />
</Tab>
</Tabs>
</Container>
试试这个:
<Tabs locked />