ReactNative全屏背景图片

What's the best way to add a full screen background image in React Native

class ReactStrap extends React.Component {
  render() {
    return (
      <Image source={require('image!background')} style={styles.container}>
        ... Your Content ...
      </Image>
    );
  }
}

var styles = StyleSheet.create({
  container: {
    flex: 1,
    // remove width and height to override fixed static size
    width: null,
    height: null,
  }
};
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,410评论 0 23
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,658评论 2 45
  • 自古红颜多命薄 时运多舛复蹉跎 生得倾国倾城貌 哪知因此致网罗 多情总被无情弃 遇人不淑泪婆娑 世人訾我张艳帜 何...
    一叶茶阅读 2,144评论 0 4
  • 这个假期应是这22年来最完美的了。 假期伊始,研究生录取,放下些许包袱的我,准备好了。 因为之前持续一个月的分手,...
    魏小豪阅读 1,664评论 2 0
  • Exercise 3 方法:打开终端运行make qemu-gdb,再打开另一个终端运行make gdb,通过b ...
    找不到工作阅读 13,405评论 0 6