rc-image-previewer

1.7.1 • Public • Published

ImagePreviewer Build Statusnpmlicense

image-previewer-demo

Demo gif here if not loaded.

How to use

Install package:

npm install --save rc-image-previewer

Import to your app:

import ImagePreviewer from 'rc-image-previewer';

Use the component:

const { width } = Dimensions.get('window');

export default class App extends React.Component {
  render() {
    const ImgWidth = width;
    const ImgHeight = ImgWidth * 0.6;
    return (
      <View style={{
        flex: 1,
        backgroundColor: '#fff',
        alignItems: 'center',
        justifyContent: 'center',
      }}>
        <ImagePreviewer
          source={MountHuang}
          style={{
            width: ImgWidth,
            height: ImgHeight,
          }}
          resizeMode="stretch"
        />
      </View>
    );
  }
}

API

API table

API name Usage
style The style of element.
source The image source, same as source.
resizeMode The image resize mode, default is contain.(Optional)

Package Sidebar

Install

npm i rc-image-previewer

Weekly Downloads

0

Version

1.7.1

License

MIT

Unpacked Size

226 kB

Total Files

9

Last publish

Collaborators

  • faichou