ios - react-native NavigatorIOS rightButton 无法点击
<p><p>react-native NavigatorIOS rightButton 无法点击。</p>
<pre><code>onRightButtonPress: function(){
this.refs.nav.push({
title: 'From Right',
component: DetailViewController,
})
},
</code></pre>
<p>当我点击 <code>rightButton</code></p> 时没有任何反应
<pre><code> render() {
return (
<NavigatorIOS ref="nav"
initialRoute={{
component: HomeScene,
title: 'NavigatorIOS Demo..',
rightButtonTitle: 'MORE!',
onRightButtonPress: this.onRightButtonPress,
leftButtonTitle:'leftItem',
}}>
</NavigatorIOS>
);
},
});
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您需要将方法绑定(bind)到“this”。
或者,使用 => 符号来定义方法。</p></p>
<p style="font-size: 20px;">关于ios - react-native NavigatorIOS rightButton 无法点击,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/38609443/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/38609443/
</a>
</p>
页:
[1]