Quicklook

API Reference: UI.QuickLook

Quick Look lets users preview Keynote, Numbers, Pages, and PDF documents, as well as images and other types of files, even if your app doesn't support these file formats.

This class works only for iOS.

For further information please refer to the following guide: https://developer.apple.com/ios/human-interface-guidelines/features/quick-look/

JavaScript
JavaScript
const Page = require("sf-core/ui/page");
const extend = require("js-base/core/extend");
const QuickLook = require('sf-core/ui/quicklook');
const FlexLayout = require('sf-core/ui/flexlayout');
const Color = require('sf-core/ui/color');
const System = require('sf-core/device/system');
const Button = require('sf-core/ui/button');
var Page1 = extend(Page)(
function(_super) {
_super(this, {
onShow: function(params) {
Application.statusBar.visible = false;
this.headerBar.visible = false;
}
});
this.layout.flexDirection = FlexLayout.FlexDirection.ROW;
this.layout.justifyContent = FlexLayout.JustifyContent.CENTER;
this.layout.alignItems = FlexLayout.AlignItems.CENTER;
var button = new Button();
button.text = "QuickLook";
button.width = 100;
button.height = 50;
button.onPress = function(){
if (System.OS == "iOS") {
var quickLook = new QuickLook();
var pdf = "assets://smartfaceuniversity.pdf";
var image = "assets://smartface.png";
quickLook.document = [pdf, image];
quickLook.titleColor = Color.DARKGRAY;
quickLook.itemColor = Color.create("#00A1F1");
quickLook.show(this);
}
}.bind(this);
this.layout.addChild(button);
}
);
module.exports = Page1;

Important :

For Images; if you have multiple sizes of image resource (e.g smartface@2x.png, smartface@3x.png); you should give exact path of an image file. QuickLook object can't get device type's appropriate resource file automatically.