【发布时间】:2016-11-22 21:55:54
【问题描述】:
我有以下 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>
我正在尝试根据this example in the react native docs 使用onPress 事件来触发this.props.navigator.popToTop();。但是,不同之处在于我希望 TabBarIOS onPress 事件触发 popToTop() 而不是子 MyNavigatorIOS 组件。我怎样才能做到这一点?
【问题讨论】:
标签: react-native tabbar tabbarios