
Product
Rubygems Ecosystem Support Now Generally Available
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
react-native-image-zoom-viewer
Advanced tools
Swiper image
Zoom while sliding
npm i react-native-image-zoom-viewer --save
$ npm install -g create-react-native-app
$ create-react-native-app AwesomeProject
AwesomeProject/App.js
, like this:import { Modal } from 'react-native';
import ImageViewer from 'react-native-image-zoom-viewer';
const images = [{
url: 'https://avatars2.githubusercontent.com/u/7970947?v=3&s=460'
}, {
url: 'https://avatars2.githubusercontent.com/u/7970947?v=3&s=460'
}, {
url: 'https://avatars2.githubusercontent.com/u/7970947?v=3&s=460'
}]
export default class App extends React.Component {
render: function() {
return (
<Modal visible={true} transparent={true}>
<ImageViewer imageUrls={images}/>
</Modal>
)
}
}
parameter | type | required | description | default |
---|---|---|---|---|
imageUrls | array | yes | Image Source | |
enableImageZoom | boolean | no | Enable image zoom | true |
onShowModal | function(content?: JSX.Element) => void | no | The callback for show modal | () => {} |
onCancel | funcion() => void | no | The callback for cancel modal | () => {} |
flipThreshold | number | no | Swipe threshold of the next page | 80 |
maxOverflow | number | no | The X position maximum, that current page can slide to the next page | 300 |
index | number | no | Init index of images | 0 |
failImageSource | string, object{uri: string} | no | placeholder for fail | '' |
loadingRender | function() => React.ReactElement<any> | no | placeholder for loading | () => null |
onSaveToCamera | function(index?: number => void | no | The callback for save to camera | () => {} |
onChange | function(index?: number => void | no | When the image changed | () => {} |
saveToLocalByLongPress | boolean | no | Enable save to camera when long press | true |
onClick | function(onCancel?: function) => void | no | Onclick | (onCancel) => {onCancel()} |
onDoubleClick | function(onCancel?: function) => void | no | OnDoubleClick | (onCancel) => {onCancel()} |
onSave | function(url: string) => void | no | The picture is saved to the local method, if you write this method will not call the system default method for Android does not support saveToCameraRoll remote picture, you can call this callback in Android call native interface | |
renderHeader | function() => React.ReactElement<any> | no | Custom header | () => null |
renderFooter | function() => React.ReactElement<any> | no | Custom footer | () => null |
renderIndicator | function(currentIndex?: number, allSize?) => React.ReactElement<any> : number | no | Custom indicator | (currentIndex, allSize) => currentIndex + "/" + allSize |
renderArrowLeft | function() => React.ReactElement<any> | no | Custom left arrow | () => null |
renderArrowRight | function() => React.ReactElement<any> | no | Cutsom right arrow | () => null |
After clone this repo, then:
npm install
npm start
cd demo
npm install
npm start
Then, scan the QR, use your expo app.
Depend on react-native-image-pan-zoom
: https://github.com/ascoders/react-native-image-zoom
FAQs
react native image viewer,大图浏览
The npm package react-native-image-zoom-viewer receives a total of 34,367 weekly downloads. As such, react-native-image-zoom-viewer popularity was classified as popular.
We found that react-native-image-zoom-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.