【发布时间】:2020-06-26 06:34:40
【问题描述】:
我已经研究了好几天了,但仍然没有得到我想要的。
我什至不知道为什么还没有提出这个问题..
例如,如果你使用
const Tab = createMaterialTopTabNavigator();
来自@react-navigation/material-top-tabs
export class TopTab extends React.Component {
render() {
return (
<Tab.Navigator
swipeEnabled={false}
tabBar={(props) => <CustomTabBar {...props} />}
>
<Tab.Screen name="First" component={FirstView} />
<Tab.Screen name="Second" component={SecondView} />
<Tab.Screen name="Third" component={ThirdView} />
</Tab.Navigator>
);
}
export class FirstView extends React.Component {
render() {
return (
<ScrollView horizontal>
.... contents
</ScrollView>
);
}
那么 ScrollView 水平滑动在这些视图中将不起作用。
我尝试过的:
swipeEnabled=true
nestedScrollViewEnabled=true
是否有任何已知的解决方案?
我尝试了使用 react-native-community/viewpager 自定义 ViewPaging 的 pager 选项,但仍然没有成功。
请帮忙!
【问题讨论】:
标签: react-native react-native-flatlist react-native-navigation react-native-scrollview react-native-swiper