本文整理汇总了TypeScript中ui/button.Button.on方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Button.on方法的具体用法?TypeScript Button.on怎么用?TypeScript Button.on使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui/button.Button
的用法示例。
在下文中一共展示了Button.on方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createButton
private createButton(): any {
// Setup the button.
var btn = new button.Button();
btn.text = "TAP";
btn.horizontalAlignment = layout.HorizontalAlignment.center;
btn.on("click", () => this.onClick() );
this.setMessage(model.Text);
return btn;
}
示例2: createPage
export function createPage() {
var page = new pages.Page();
var btn = new button.Button();
btn.text = "GO!";
btn.on(button.Button.tapEvent, function() {
prof.startCPUProfile("main-page");
var nextPage = "views/main-page/main-page";
frame.topmost().navigate(nextPage);
// testListenersCreate();
});
page.content = btn;
return page;
}
示例3: constructor
constructor() {
super();
var counter: number = 0;
// this.lbl = new Label({"text" : "Select Matter"});
//var lbl:Label = new Label();
this.lbl = new Label();
var btn:Button = new Button();
this.lbl.text="Tap";
btn.text = "Tap me!";
btn.on(Button.tapEvent, (args: EventData) => {
this.lbl.text = "Tap " + counter++;
});
this.addChild(this.lbl);
this.addChild(btn);
}
示例4: createView
function createView() {
const page = new Page();
const layout = new StackLayout();
page.content = layout;
const label = new Label();
label.text = scan.content;
label.className = "details-content";
layout.addChild(label);
const date = new Label();
date.text = scan.date.toLocaleString('en');
layout.addChild(date);
if (callback) {
const button = new Button();
button.text = "Open";
button.on("tap", callback);
layout.addChild(button);
}
return page;
}