图像未出现在 React Native 应用程序的 ListView 中
Image not appearing within ListView in a react native application
我有一个渲染图像的 ListView。
<ListView
renderRow={this.renderRow}
dataSource={this.dataSource}
pageSize={4}
initialListSize={4}
contentInset={{ bottom: 50 }}
automaticallyAdjustContentInsets={false}
/>
renderRow 方法渲染图像如下:
<View style={styles.itemSection}>
<Image
source={{ uri: card.image }}
style={styles.itemImage}
resizeMode="cover"
/>
</View>
图像没有得到渲染。截图如下:
在将图像嵌入 ListView 之后,图像得到了适当的呈现。在 ListView 中查看图像的任何指示?
图片示例 url 是:http://s3.amazonaws.com/sendto.us/postcards/fronts/000/000/017/original/from_api.png?1471627160
分享风格:
itemSection: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
borderBottomColor: '#ccc',
borderBottomWidth: StyleSheet.hairlineWidth,
flexDirection: 'row',
},
itemImage: {
width: 120,
height: 80,
borderWidth: 2,
borderColor: '#333',
},
尝试将此添加到您的 info.plist
另请参考
和
我有一个渲染图像的 ListView。
<ListView
renderRow={this.renderRow}
dataSource={this.dataSource}
pageSize={4}
initialListSize={4}
contentInset={{ bottom: 50 }}
automaticallyAdjustContentInsets={false}
/>
renderRow 方法渲染图像如下:
<View style={styles.itemSection}>
<Image
source={{ uri: card.image }}
style={styles.itemImage}
resizeMode="cover"
/>
</View>
图像没有得到渲染。截图如下:
在将图像嵌入 ListView 之后,图像得到了适当的呈现。在 ListView 中查看图像的任何指示?
图片示例 url 是:http://s3.amazonaws.com/sendto.us/postcards/fronts/000/000/017/original/from_api.png?1471627160
分享风格:
itemSection: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
borderBottomColor: '#ccc',
borderBottomWidth: StyleSheet.hairlineWidth,
flexDirection: 'row',
},
itemImage: {
width: 120,
height: 80,
borderWidth: 2,
borderColor: '#333',
},
尝试将此添加到您的 info.plist
另请参考