Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

relative width and height image react native

const dimensions = Dimensions.get('window');
const imageHeight = Math.round(dimensions.width * 9 / 16);
const imageWidth = dimensions.width;

return (
   <Image
     style={{ height: imageHeight, width: imageWidth }}
   />
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #relative #width #height #image #react #native
ADD COMMENT
Topic
Name
4+8 =