本文整理汇总了TypeScript中ui/button.Button类的典型用法代码示例。如果您正苦于以下问题:TypeScript Button类的具体用法?TypeScript Button怎么用?TypeScript Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Button类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getButtonColors
function getButtonColors(): void {
const Button = require("ui/button").Button;
const btn = new Button();
applySelectors(btn);
buttonColor = btn.color;
buttonBackgroundColor = btn.backgroundColor;
btn.onUnloaded();
}
示例2: 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;
}
示例3: 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;
}
示例4: 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);
}
示例5: 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;
}