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

  • 關於本站
  • 免責聲明