本文整理匯總了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;
}