You can use this class and use this component in your whole app
export const HEIGHT = Dimensions.get('window').height;
export const WIDTH = Dimensions.get('window').width;
export const getResponsiveHeight = (per) => {
return ((HEIGHT * per) / 100);
}
export const getResponsiveWidth = (per) => {
return ((WIDTH * per) / 100);
}
eg:
if you want to use getResponsiveHeight then you have to use it like this
width:getResponsiveHeight(0.5)
per here is the value 0.5
you can pass the value according to your requirement.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…