npm i --save @happones/nativescript-image-zoom
- 版本:4.0.2
- GitHub:
- NPM: https://npmjs.net.cn/package/%40happones%2Fnativescript-image-zoom
- 下载量
- 前一天: 0
- 上周: 2
- 上个月: 10
NativeScript Image Zoom
安装
NativeScript 7+
tns plugin add @happones/nativescript-image-zoom
NativeScript > 7
tns plugin add nativescript-image-zoom
配置
重要:确保在 Page 元素中包含 xmlns:ui="nativescript-image-zoom"
<ui:ImageZoom src="~/images/148080.jpg" maxZoom="5" minZoom="2"/>
Angular
import { registerElement } from 'nativescript-angular/element-registry';
registerElement('ImageZoom', () => require('nativescript-image-zoom').ImageZoom);
<ImageZoom src="~/images/148080.jpg" maxZoom="5" minZoom="2"></ImageZoom>
Vue
import ImageZoomPlugin from '@happones/nativescript-image-zoom/vue';
Vue.use(ImageZoomPlugin);
<ImageZoom src="~/images/148080.jpg" maxZoom="5" minZoom="2"></ImageZoom>
API
属性
属性 | 默认值 | 类型 | 必需 | 描述 |
---|---|---|---|---|
maxZoom | 5 | 数字 |
|
|
minZoom | 1 | 数字 |
|
|
zoomScale | 1 | 数字 |
|
仅限 iOS |
src | 字符串 |
|
屏幕截图
iOS | Android |
---|---|
![]() |
![]() |