我有以下 TabBarIOS.Item 设置:
<TabBarIOS.Item
selected={this.state.selectedTab === 'tab1'}
title='Tab 1'
icon={require('./Components/Icons/IconImages/Tab1Icon.png')}
onPress={() => {
this.setState({
selectedTab: 'tab1'
});
}}>
<MyNavigatorIOS client={this.state.client} initialStep={this.state.initialStep} />
</TabBarIOS.Item>
我正在尝试根据 react native docs 中的此示例使用该事件来onPress
触发。但是,不同之处在于我希望触发 TabBarIOS事件而不是子组件。我怎样才能做到这一点?this.props.navigator.popToTop();
onPress
popToTop()
MyNavigatorIOS