logo
  • 教程列表
  • SO官方文档
  • 图片
    • 图像模块
    • 图像示例
    • 条件图像源
    • 使用变量用于图像路径
    • 适合图像
  1. StackOverflow 文档
  2. react-native 教程
  3. 图片
  4. 条件图像源

条件图像源

Created: November-22, 2018

<Image style={[this.props.imageStyle]}
        source={this.props.imagePath
        ? this.props.imagePath
        : require('../theme/images/resource.png')}
    />

如果路径在 imagePath 中可用,则它将被分配给源,否则将分配默认图像路径。

  • 使用变量用于图像路径
  • 图像示例

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明