如何使用可触摸不透明度在侧面菜单中按

How to use TouchableOpacity onPress in side menu?

本文关键字:侧面 菜单 不透明度 何使用 触摸      更新时间:2023-09-26

如何在侧边菜单中实现指向其他页面的活动链接?
我在我的应用程序上使用此示例 https://github.com/react-native-fellowship/react-native-side-menu/tree/master/examples/Basic,但是当我添加带有onPress函数的TouchableOpacity

this.props.navigator.push({
        name: 'Main'
    });

我有一个错误"无法读取未定义的属性'推送'"。所有功能在侧边菜单打开时执行(在我按下按钮之前)。如何解决?

我有一个错误"无法读取未定义的属性'推送'"。

您需要使用

<Menu navigator={this.props.navigator}/>

而不是

<Menu/>