當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript button.Button類代碼示例

本文整理匯總了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();
}
開發者ID:triniwiz,項目名稱:NativeScript,代碼行數:8,代碼來源:dialogs-common.ts

示例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;
    }
開發者ID:siyka-marinova,項目名稱:TSProj,代碼行數:11,代碼來源:main.ts

示例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;
}
開發者ID:phattranky,項目名稱:nativescript-marketplace-demo,代碼行數:15,代碼來源:profile-main.ts

示例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);
    }
開發者ID:tsonevn,項目名稱:CustomView,代碼行數:17,代碼來源:customView.ts

示例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;
	}
開發者ID:PacktPublishing,項目名稱:TypeScript-Blueprints,代碼行數:23,代碼來源:details.ts


注:本文中的ui/button.Button類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。