【发布时间】:2019-10-28 10:05:56
【问题描述】:
当我按下按钮时,我正在尝试hide bottomTabbar。
在我的 App.js 文件中,我有我的 ButtomTabNavigator :
const ButtomTabNavigator = createBottomTabNavigator(
{
screenOne: {
screen: RealReviewMain,
navigationOptions: ({ navigation }) => ({
tabBarVisible: true,
})
},
screenTwo: {
screen: RealReviewMain,
//Here I set the tabbarVisible to true
navigationOptions: ({ navigation }) => ({
tabBarVisible: true,
})
},
},
)
在 ScreenTwo 中,我尝试使用 onPresshide bottom tabbar
<TouchableOpacity
onPress={()=> {
this.props.navigation.setParams({ tabBarVisible: false });
}}/>
这是正确的做法吗?什么都没有发生。
任何建议或评论将不胜感激!提前致谢!
【问题讨论】:
标签: reactjs react-native react-navigation