How to change height of bottom material tab navigator from react-naviagtion 1

How to change height of bottom material tab navigator from react-naviagtion

import { Dimensions, Platform, PixelRatio } from 'react-native';

const {
  width: SCREEN_WIDTH,
  height: SCREEN_HEIGHT,
} = Dimensions.get('window');

// based on iphone 5s's scale
const scale = SCREEN_WIDTH / 320;

export function normalize(size) {
  const newSize = size * scale 
  if (Platform.OS === 'ios') {
    return Math.round(PixelRatio.roundToNearestPixel(newSize))
  } else {
    return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2
  }
}

Here is what the above code is Doing:
1. We’re getting the screen width and height from the Dimensions API.
2. We’re using the screen width to calculate a scale factor.
3. We’re using the scale factor to normalize the font size.
4. We’re using the PixelRatio API to round the font size to the nearest pixel.
5. We’re subtracting 2 from the font size on Android to account for the shadow.

Now, we can use the normalize function to normalize the font size in our stylesheet:

Similar Posts