Created
April 24, 2018 22:08
-
-
Save naranjja/e9cf5574dc125955236af7144742c529 to your computer and use it in GitHub Desktop.
Popup implementation in NativeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onLoaded" navigatedTo="onNavigatedTo" actionBarHidden="true"> | |
<Button id="bOpenPopup" text="Open popup" tap="onOpenPopupTap" /> | |
</Page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tns plugin add nativescript-popup | |
const { Popup } = require("nativescript-popup") | |
exports.onOpenPopupTap = (args) => { | |
const page = args.object | |
const popup = new Popup({ | |
backgroundColor: 'white', | |
height: 50, | |
width: 100, | |
unit: "%", | |
elevation: 10, | |
borderRadius: 25 | |
}) | |
popup.showPopup(page.getViewById('bOpenPopup'), '~/path/to/some/template.xml') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackLayout> | |
<Label text="This is some template" textWrap="true" /> | |
</StackLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment