首页 > 解决方案 > 如何在本机反应中在平面列表上显示图像

问题描述

我正在用 react native 构建一个应用程序。我想在一个平面框中显示一些图像。如何在 react native 的平面列表上显示图像 这是我的代码

标签: imagereact-nativereact-native-flatlist

解决方案


来自 React Native文档

请注意,对于网络和数据图像,您需要手动指定图像的尺寸!

像这样:

<Image
      style={{width: 50, height: 50}}
      source={{uri: 'http://sslweb.solidstatelogic.com.s3.amazonaws.com/user-icon.png'}}
    />

推荐阅读