イメージをレンダリングするListViewがあります。イメージが反応するネイティブアプリケーションのListView内に表示されない
<View style={styles.itemSection}>
<Image
source={{ uri: card.image }}
style={styles.itemImage}
resizeMode="cover"
/>
</View>
画像がレンダリング取得されていない次のよう
<ListView
renderRow={this.renderRow}
dataSource={this.dataSource}
pageSize={4}
initialListSize={4}
contentInset={{ bottom: 50 }}
automaticallyAdjustContentInsets={false}
/>
でrenderRow方法は、画像をレンダリングします。以下のスクリーンショット:
イメージをリストビューに埋め込むと、画像が適切にレンダリングされていました。リストビュー内で画像を表示するためのポインタはありますか?
画像の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',
},
イメージはSVGではありませんか? – dv3
これはpngまたはjpg画像です。 – vijayst
は、styles.itemImageとstyles.itemSectionを共有します。 –