【发布时间】:2019-02-17 22:56:19
【问题描述】:
我在 ScrollView 中有一个 TabNavigator,它在 ios 中运行良好,但在 android 中却不行。 TAB 内容不可见,并且单击选项卡不起作用。 请参阅下面链接中的工作示例。
试过了:
- 为 ScrollView 添加 flex: 1 或高度。
-
给标签添加 flex: 1 或高度。
export default class App extends React.Component { render() { return ( <View style={styles.container}> <TabNavigator/> <Text style={styles.paragraph}> Change code in the editor and watch it change on your phone! Save to get a shareable url. </Text> <View> <AssetExample/> </View> <ScrollView style={{height: 500}}> <TabNavigator/> </ScrollView> </View> ); } } const TabNavigator = createMaterialTopTabNavigator({ TabOne: Tab1, TabTwo: Tab2, }, { tabBarOptions: { activeTintColor: '#5B71F9', inactiveTintColor: '#888888', showIcon: false, labelStyle: { fontSize: 14 }, style: { backgroundColor: '#fff', shadowColor: '#fff', shadowOffset: { width: 0, height: 0, }, shadowOpacity: 0, shadowRadius: 0, elevation: 0, height: 47, borderBottomWidth: 1, borderBottomColor: '#E8E8E8' }, indicatorStyle: { height: 2, backgroundColor: '#5B71F9' } } });
【问题讨论】:
-
请更具体地说明您面临的问题,并粘贴一些代码示例并说明您到目前为止尝试过的内容。
-
嘿,伙计们。当ScrollView里面的TabNavigator,TAB面板消失,下面的链接就可以看到效果了[link](snack.expo.io/@15101668168/joyous-tortilla)@OriPrice
-
请在问题中添加特定代码 sn-ps,以及您迄今为止尝试过的内容,以便我们为您提供指导。
-
好的,谢谢! @OriPrice
标签: android react-native scrollview react-navigation tabcontrol