本机NavigatorIOS右键按钮无法点击

时间:2016-07-27 09:47:38

标签: ios react-native

react-native NavigatorIOS rightButton无法点击。

onRightButtonPress: function(){

     this.refs.nav.push({
       title: 'From Right',
       component: DetailViewController,
     })
  },

单击rightButton

时没有任何反应
 render() {
    return (
      <NavigatorIOS ref="nav"

        initialRoute={{
          component: HomeScene,       
          title: 'NavigatorIOS Demo..', 
          rightButtonTitle: 'MORE!', 
          onRightButtonPress: this.onRightButtonPress, 

          leftButtonTitle:'leftItem',
        }}>
      </NavigatorIOS>
    );
  },
});

1 个答案:

答案 0 :(得分:0)

你需要将方法绑定到这个&#39;这个&#39;。 或者,使用=&gt;用于定义方法的符号。