Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Image Viewer Component For React Native (like twitter)

License

NotificationsYou must be signed in to change notification settings

Tinysymphony/react-native-zoom-image

Repository files navigation

ZoomImage component for React Native Application (ios / android)

Only works with https network images [With the limitation of the current react-native, we can't get original size of required images. This component just zooms them with given size (provided byimgStyle prop)]

If you need to support http network images, modify info.plist please :)

Examples

Usage

install from npm

npm install --save react-native-zoom-image

import in project

importZoomImagefrom'react-native-zoom-image';import{Easing}from'react-native';// import Easing if you want to customize easing function
letstyles={img:{}// custom styles of original image component};// in render function<ZoomImagesource={{uri:'https://ooo.0o0.ooo/2017/03/31/58de0e9b287f6.jpg'}}imgStyle={{width:250,height:230}}style={styles.img}duration={200}enableScaling={false}easingFunc={Easing.ease}/>

Properties

PropTypeDefaultDescription
disabledboolfalseWhether to disable the component or not.
startCaptureboolfalseWhether to capture start touch event or not.
moveCaptureboolfalseWhether to capture move event or not.
responderNegotiatefunction-Use custom conditions to enable or disable gesture over image modal.
easingFuncfunctionEasing.linearThe easing function of animation.
showDurationnumber100The duration of showing the image modal.
closeDurationnumber140The duration of closing the image modal.
rebounceDurationnumber800The total duration of resetting the position of image. The actual duration changes by the displacement of the image in Y-axis. If the displacement equals to the height of screen, the duration shall be 800ms.
enableScalingboolfalseWhether to scale the image when it is polled.

Instance methods

MethodParamsDescription
openModal-Open image modal
closeModal-Close image modal.

LICENSE MIT

About

Image Viewer Component For React Native (like twitter)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp