Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

full width of image and maintain aspect ratio react native

render() {
    let image = this.props.requireSource;
    const { width, height } = Image.resolveAssetSource(image);
    const ratio = height / width;
    const SCREEN_WIDTH = Dimensions.get('window').width;

    return (
        <Image source={image} style={{width: SCREEN_WIDTH, height: SCREEN_WIDTH*ratio}} resizeMode="contain"/>
    );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: swal is not defined 
Javascript :: javacript contextmenu preventDefault 
Javascript :: js remove readonly attribute 
Javascript :: react native duplicate resources: Android 
Javascript :: jquery check if checkbox is checked 
Javascript :: jquery click function 
Javascript :: how to get last path from url in javascript 
Javascript :: gitignore all node_modules 
Javascript :: javascript gcd 
Javascript :: javascript change meta tag 
Javascript :: socket io cdn 
Javascript :: is advanced functions harder than calculus 
Javascript :: javascript selection sort 
Javascript :: remove square brackets from string javascript 
Javascript :: random number between min and max script 
Javascript :: command to create react app 
Javascript :: set value javascript by id 
Javascript :: math random equitative js 
Javascript :: date add 1 hour javascript 
Javascript :: pass url params to child router express 
Javascript :: npm global flag 
Javascript :: how to run vue js project on different port 
Javascript :: react native scrollview horizontal 
Javascript :: DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#findandmodify 
Javascript :: js alert and redirect 
Javascript :: how to append select option in jquery 
Javascript :: disable input field from jquery 
Javascript :: javascript move element in array to end 
Javascript :: set width screen angular 
Javascript :: CLEAR FORM using jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =