1.1.7 • Published 6 years ago

react-native-imagebox v1.1.7

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

react-native-lightbox

Installation

yarn add react-native-imagebox

or  npm install react-native-imagebox

Usage

Save the image to the local ios rely on CameraRoll android at the same time rely on CameraRoll and react - native - fs

import ImageBox from "react-native-imagebox";

    ​//数组中图片的个数决定弹出轮播图的的图片个数
    
    let images = [
      "http://otn4d80hz.bkt.clouddn.com/98210784.jpg",
      "http://otn4d80hz.bkt.clouddn.com/WechatIMG11.jpeg"
    ]

    // 用于 item 中图片的显示
      <View style={styles.moreImage}>
            <ImageBox
                imageStyle = {{height:200,width:200}}
                underlayColor = "#fff"
                showIndex = {0}      
                images = {images}
                imagesource = {images[0]}>
            </ImageBox>
      </View>
);

moreImage:{
    width:myUtil.size.width,
    flexDirection: 'row',
    flexWrap:'wrap'
},

moreImageView:{
    height:myUtil.size.width/3,
    width:myUtil.size.width/3
}

Properties

PropTypeDescription
activePropsobjectOptional set of props applied to the content component when in lightbox mode. Usable for applying custom styles or higher resolution image source.
renderHeader(close)functionCustom header instead of default with X button
renderContentfunctionCustom lightbox content instead of default child content
onClosefunctionTriggered when lightbox is closed
onOpenfunctionTriggered when lightbox is opened
underlayColorstringColor of touchable background, defaults to black
backgroundColorstringColor of lightbox background, defaults to black
swipeToDismissboolEnables gestures to dismiss the fullscreen mode by swiping up or down, defaults to true.
springConfigobjectAnimated.spring configuration, defaults to { tension: 30, friction: 7 }.

GifImage

Image