[javascript] How to use ImageBackground to set background image for screen in react-native

ImageBackground is a very simple and useful component.Put your component inside ImageBackground as a nested component and tweak a position of your component by using position.

Here's an example.

_x000D_
_x000D_
<ImageBackground_x000D_
  source={{ uri: hoge }}_x000D_
  style={{_x000D_
    height: 100,_x000D_
    width: 100,_x000D_
    position: 'relative', _x000D_
    top: 0,_x000D_
    left: 0_x000D_
  }}_x000D_
>_x000D_
  <Text_x000D_
    style={{_x000D_
      fontWeight: 'bold',_x000D_
      color: 'white',_x000D_
      position: 'absolute', _x000D_
      bottom: 0, _x000D_
      left: 0_x000D_
    }}_x000D_
  >_x000D_
    Hello World_x000D_
  </Text>_x000D_
</ImageBackground>
_x000D_
_x000D_
_x000D_