nativeScript-image-popup
适用于 NativeScript 的图片弹出插件。
npm i --save nativescript-image-popup

适用于 NativeScript 的图片弹出插件。

基于

安装

NativeScript 6x

tns plugin add nativescript-image-popup

Android 规范

使用示例

import { ImagePopup } from 'nativescript-image-popup';
import { ImagePopupOptions } from 'nativescript-image-popup/classes';

// basic use
ImagePopup.localImagePopup("~/assets/images/nmb.jpg");

// or

ImagePopup.networkImagePopup("https://i.hizliresim.com/kx47Db.png");


// with options
const options: ImagePopupOptions = {
path: "https://i.hizliresim.com/kx47Db.png",
width: 500,
height: 500,
fullScreen: true,
backgroundColor:ImagePopupBackgroundColors.TRANSPARENT, // or manuel color ( red, blue #ffd200)
hideCloseIcon: false;
imageOnClickClose: true
};

ImagePopup.localImagePopup(options);

// or

ImagePopup.networkImagePopup(options);

NativeScript Image Popup - 方法

  • localImagePopup(options: ImagePopupOptions | string)
  • networkImagePopup(options: ImagePopupOptions | string)

为什么使用 TNS 前缀的名称?

TNS 代表 Telerik NativeScript

iOS 使用以 NS 前缀的类(源自古老的 NeXTSTEP 时代):https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/

为了避免与 iOS 原生类混淆,使用 TNS

演示

需要更多帮助将这些图片弹出功能集成到您的应用程序中?请查看这些使用插件的教程

NativeScript Core 演示中的图片弹出

NativeScript Angular 演示中的图片弹出

许可证

MIT