You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was displaying a placeholder when the image is not yet loaded.
I'm doing something like this
{!this.state.loaded ? this.renderPlaceholder() : null}
<FastImage
source={{uri: uri, cache: 'immutable'}}
style={[{...size, borderRadius: 5}, this.state.loaded ? {} : {width: 0, height: 0}]}
onLoadEnd={this.onLoadEnd.bind(this)}
/>
```
onLoadEnd I set the state of loaded to true. This works perfectly fine on iOS, but on Android the onLoadEnd event is never triggered when we have width and height of 0. So you end up with hacks to make it work on both Platform. I ended up ditching the 0 width and height and absolutely positioning the image behind the placeholder. This way you don't see a jump in the UI when the image gets loaded and the placeholder is destroyed.
The text was updated successfully, but these errors were encountered:
I was displaying a placeholder when the image is not yet loaded.
I'm doing something like this
The text was updated successfully, but these errors were encountered: