Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to fit content of a Stack Navigator inside View?

$
0
0
const TabNavigator = () => (<Stack.Navigator screenOptions={{headerShown: false}}><Stack.Screen name="Order" component={OrderScreen} /><Stack.Screen name="Shops" component={ShopScreen} /><Stack.Screen name="Categories" component={CategoryScreen} /><Stack.Screen name="Profile" component={ProfileScreen} /></Stack.Navigator>);const MainScreen = ({navigation}) => {  return (<ScrollView style={styles.rootContainer}><StatusBar backgroundColor="#fff" barStyle="dark-content" /><View style={styles.navigationContainer}><View style={styles.topIconContainer}><Image            source={{uri: 'https://picsum.photos/id/237/200/300'}}            style={styles.topIcons}          /><Image            source={{uri: 'https://picsum.photos/id/1005/200/300'}}            style={styles.topIcons}          /></View><Text          style={{            fontSize: 35,            width: Dimensions.get('screen').width / 2,            fontWeight: 'bold',            marginBottom: 20,          }}>          Grocery Delivery</Text><View style={styles.navigator}><TouchableOpacity            style={styles.navigatorButtons}            onPress={() => {              navigation.navigate('Order');            }}><Text>Order</Text><View style={styles.navigatorIndicators} /></TouchableOpacity><TouchableOpacity            style={styles.navigatorButtons}            onPress={() => {              navigation.navigate('Shops');            }}><Text>Shops</Text><View style={styles.navigatorIndicators} /></TouchableOpacity><TouchableOpacity            style={styles.navigatorButtons}            onPress={() => {              navigation.navigate('Categories');            }}><Text>Category</Text><View style={styles.navigatorIndicators} /></TouchableOpacity></View></View>      {/* MY PROBLEM */}<View style={{height: 500}}><TabNavigator /></View></ScrollView>  );};

My Problem:By default, the height of the View (under the comment I put the code) is zero.

Expected:The View should have a min-height of the TabNavigator so that it does not clip its content.

I want the View (the last child inside the main parent) to adjust itself to the height of TabNavigator


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>