NavigatorIOS component not visible when used within TabBarIOS
See original GitHub issueThe NavigatorIOS
component is rendered but not visible when used within TabBarIOS
. However, it is visible in the Chrome and Xcode debuggers.
Rendered App
Chrome Debugger View
Xcode Captured View Hierarchy
App Code
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TabBarIOS,
NavigatorIOS
} = React;
var ApplePage = React.createClass({
render: function () {
return (
<View style={styles.view}>
<Text style={styles.text}>Hello</Text>
<Text style={styles.text}>World</Text>
</View>
)
}
})
var MainView = React.createClass({
getInitialState: function() {
return {
selectedTab: 'appleTab',
notifCount: 0,
presses: 0,
};
},
render: function () {
return (
<TabBarIOS>
<TabBarIOS.Item
title="Apple Tab"
icon={_icon('more')}
selected={this.state.selectedTab === 'appleTab'}
onPress={() => {
this.setState({
selectedTab: 'appleTab',
});
}}>
<NavigatorIOS
initialRoute={{
title: 'Apple',
component: ApplePage,
}}
/>
</TabBarIOS.Item>
</TabBarIOS>
)
}
})
function _icon(imageUri) {
return {
uri: imageUri,
isStatic: true
};
}
var styles = React.StyleSheet.create({
text: {
color: 'black',
backgroundColor: 'white',
fontSize: 50,
marginTop: 100
},
container: {
flex: 1
}
})
AppRegistry.registerComponent('MartialApp', () => MainView)
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
NavigatorIOS doesn't work with TabBarIOS · Issue #504 · facebook ...
When the tab is selected, it does not display the NavigatorIOS correctly. The navigation bar appears at the top (and the navigator's initial...
Read more >React Native : TabBarIOS and Navigation - Stack Overflow
But for second item, i tried using navigatorios to show component, but it shows only a blank page with title. it doesn't show...
Read more >Implementing TabBarIOS with React Native | by Devsteam.mobi
Give each PreviousMonthsList its own NavigatorIOS component so that the TabBarIOS component does not disappear when PreviousMonthsList navigates to a previous ...
Read more >NavigatorIOS · React Native
In this code, the navigator renders the component specified in initialRoute, which in this case is MyScene . This component will receive a...
Read more >react-native-vector-icons - npm
Perfect for buttons, logos and nav/tab bars. Easy to extend, style and integrate into your project. Main advantages over react-native-icons.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The View that NavigatorIOS creates has no dimensions, toss a style that has {flex: 1} on it, and paddingTop: 64, flex: 1 on the myPage View and you’ll be all set 😃
@nickhudkins Thanks for saving my time.