Closed sospartan closed 6 years ago
I found this behavior when change android native code to disable dev menu. I block-commented the detect menu key part :
@Override public boolean onKeyUp(int keyCode, KeyEvent event) { /*if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { mReactInstanceManager.showDevOptionsDialog(); return true; }*/ return super.onKeyUp(keyCode, event); }
After rerun the app , hit the menu key twice , the TabBar is gone ... I can't figure out the reason.
Environment:
Javascript code:
'use strict'; import React,{AppRegistry,View,Text} from 'react-native'; import TabNavigator from 'react-native-tab-navigator'; var TabPage = React.createClass({ propTypes:{ text:React.PropTypes.number }, render:function(){ return (<View style={{flex:1,top:0,alignItems:'center',justifyContent:'center',backgroundColor:'grey'}}> <Text >{this.props.text}</Text> </View>); } }); var App = React.createClass({ getInitialState: function() { return { selectedTab: 'tab1', }; }, render:function(){ return ( <TabNavigator style={{flex:1,backgroundColor:'green'}}> <TabNavigator.Item selected={this.state.selectedTab === 'tab1'} onPress={() => this.setState({ selectedTab: 'tab1' })} title="tab1" > <TabPage text={1}/> </TabNavigator.Item> <TabNavigator.Item selected={this.state.selectedTab === 'tab2'} onPress={() => this.setState({ selectedTab: 'tab2' })} title="tab2" > <TabPage text={2}/> </TabNavigator.Item> </TabNavigator> ); } }); AppRegistry.registerComponent('Index', () => App);
I am not sure what happened. Anyone else have an idea?
Will close since this issue is more than a year, feel free to a open a new if this is still a issue.
I found this behavior when change android native code to disable dev menu. I block-commented the detect menu key part :
After rerun the app , hit the menu key twice , the TabBar is gone ... I can't figure out the reason.
Environment:
Javascript code: