Image Popup plugin for NativeScript.
Based on:
- Android chathuralakmal/AndroidImagePopup
- iOS - Coming Soon.
tns plugin add nativescript-image-popup
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);
localImagePopup(options: ImagePopupOptions | string)
networkImagePopup(options: ImagePopupOptions | string)
TNS
stands for Telerik NativeScript
iOS uses classes prefixed with NS
(stemming from the NeXTSTEP days of old):
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/
To avoid confusion with iOS native classes, TNS
is used instead.
Need extra help getting these Image Popup working in your application? Check out these tutorials that make use of the plugin:
Image Popup in a NativeScript Core Demo
Image Popup in a NativeScript Angular Demo
MIT