본문 바로가기
리액트네이티브

[리액트 네이티브] 배경이미지 넣기 ImageBackground

by 알찬 퍼블리셔 2019. 9. 17.
728x90
반응형
import React from "react";
import { StyleSheet, View, ..., ImageBackground, ... } from "react-native";
...


export default class App extends React.Component {
	render(){
    	return(
        	<View>
            <ImageBackground 
            	style={{ width: "100%", height: "100%" }}  //View를 꽉채우도록
                source={require("./assets/background.png")}  //이미지경로
                resizeMode="cover" // 'cover', 'contain', 'stretch', 'repeat', 'center' 중 선택 
                >
            </ImageBackground>
            
            </View>
        
        );
    }

}

 

 

 

https://docs.expo.io/versions/v34.0.0/react-native/imagebackground/

 

ImageBackground - Expo Documentation

A common feature request from developers familiar with the web is background-image. To handle this use case, you can use the component, which has the same props as , and add whatever children to it you would like to layer on top of it. You might not want t

docs.expo.io

 

728x90
반응형

댓글