我有问题。我有一个listview。我想在屏幕上等待显示图像时添加加载图像。 我已经尝试过react-native-fast-image,react-native-image-progress。但不是。 你可以帮助我。 thankssss。
Index.js
<ListView
enableEmptySections
style={styles.list}
dataSource={this.state.dataSource}
renderRow={rowData => <ArtStreamRow artwork={rowData} />}
scrollRenderAheadDistance={3000}
initialListSize={30}
onEndReached={this.onEndReached}
onEndReachedThreshold={900}
refreshControl={
<RefreshControl
refreshing={this.props.isRefreshing}
onRefresh={this.onRefresh}
/>
ArtStreamRow.js
class ArtStreamRow extends PureComponent {
render() {
const {
artwork,
} = this.props;
return (
<View style={styles.container}>
<TouchableNativeFeedback
onPress={viewArtworkDetail.bind(this, artwork)}
background={Platform.OS === 'android' ?
TouchableNativeFeedback.SelectableBackground() : ''}
>
<Image
source={{ uri: getUrl(artwork) }}
style={styles.artworkImage}
resizeMode={Image.resizeMode.cover}
/>
</TouchableNativeFeedback>
</View>
)
}