I'm hosting two tab components in a js file. If a render only tab router its working perfectly. if i try to render inside View component its not rendering tabs.
my RegisterHost.js render method.
render() {
return (
<View>
<Text>This is main home Component</Text>
<Tab />
</View>
);
}
Its rendering only 'This is main Home Component'
if I comment View and text components. Its rendering Tab perfectly.
render() {
return (
// <View>
// <Text>This is main home Component</Text>
<Tab />
//</View>
);
}
my Tab router config
export const Tab = TabNavigator(
{
BankCustomerRegister: {
screen: BankCustomerRegister,
navigationOptions: {
tabBarLabel: "Bank Customer"
}
},
nonbankcustomer: {
screen: NonCustomerRegister,
navigationOptions: {
tabBarLabel: "New Customer"
}
}
},
I'm not sure where its going wrong. Is there something am missing.
尝试将style={{flex: 1}}
到RegisterHost.js的父视图中
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.