React-native >= 0.46.x
npm install --save rn-image-placeholder
import ImageLoader from 'rn-image-placeholder';
....
<ImageLoader
style={{ width: 320, height: 250 }}
loadingStyle={{ size: 'large', color: 'blue' }}
source={{ uri: 'https://images.pexels.com/photos/5970/road-nature-forest-trees.jpg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940' }}
/>
Supports all Image properties.
Option | Default | Info |
---|---|---|
placeholderSource | require('./img/img_empty.png') | Show placeholderSource if the source can't be loaded or error. |
loadingStyle | size: 'small'; color: 'gray' | Style ActivityIndicator |
isShowActivity | true | Show ActivityIndicator loading |
placeholderStyle | Style placeholder image | |
customImagePlaceholderDefaultStyle | Custom style image placeholder default | |
borderRadius | Border radius |
ISC