React-native-fast-image: Methods don't work on Android

Created on 9 Jan 2019  ·  4Comments  ·  Source: DylanVann/react-native-fast-image

I used spinner while image is loading by using onLoadEnd() method.
It worked on iOS.
But it doesn't work on Android.

{isLoadedImage === false ? (
          <Spinner color={Colors.brandPrimary} style={Styles.spinner} />
        ) : null}
        <FastImage
          style={isLoadedImage ? Styles.thumb : [Styles.thumb, Styles.hidden]}
          source={{
            uri: photoUrl,
            priority: FastImage.priority.high,
          }}
          onLoadEnd={() => this.setState({ isLoadedImage: true })}
        />

So I tried to use other methods : onLoadStart(), onProgress(), onLoad().
I found that only onLoadStart() method works.

Most helpful comment

i'm having the same problem. i think this happens if you set the width/height of the FastImage to 0.

All 4 comments

i'm having the same problem. i think this happens if you set the width/height of the FastImage to 0.

@wuifdesign Yep - I can confirm that if I set width/height to 0, the onLoad callback is never fired

将其修复为#446

Using this component in Android will find performance issues with fps reduction. Have you ever encountered it?

Was this page helpful?
0 / 5 - 0 ratings