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


TypeScript DockLayout.addChild方法代碼示例

本文整理匯總了TypeScript中ui/layouts/dock-layout.DockLayout.addChild方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DockLayout.addChild方法的具體用法?TypeScript DockLayout.addChild怎麽用?TypeScript DockLayout.addChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ui/layouts/dock-layout.DockLayout的用法示例。


在下文中一共展示了DockLayout.addChild方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test_dock_left_top_righ_bottom_fill

export function test_dock_left_top_righ_bottom_fill() {
    var testBtnLeft = new helper.MyButton();
    testBtnLeft.width = 20;
    rootLayout.addChild(testBtnLeft);

    var testBtnTop = new helper.MyButton();
    testBtnTop.height = 20;
    dockModule.DockLayout.setDock(testBtnTop, enums.Dock.top);
    rootLayout.addChild(testBtnTop);

    var testBtnRight = new helper.MyButton();
    testBtnRight.width = 20;
    dockModule.DockLayout.setDock(testBtnRight, enums.Dock.right);
    rootLayout.addChild(testBtnRight);

    var testBtnBottom = new helper.MyButton();
    testBtnBottom.height = 20;
    dockModule.DockLayout.setDock(testBtnBottom, enums.Dock.bottom);
    rootLayout.addChild(testBtnBottom);

    var testBtnFill = new helper.MyButton();
    dockModule.DockLayout.setDock(testBtnFill, enums.Dock.bottom);
    rootLayout.addChild(testBtnFill);

    TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });

    helper.assertLayout(testBtnLeft, 0, 0, 20, 300, "Left button");
    helper.assertLayout(testBtnTop, 20, 0, 280, 20, "Top button");
    helper.assertLayout(testBtnRight, 280, 20, 20, 280, "Right button");
    helper.assertLayout(testBtnBottom, 20, 280, 260, 20, "Bottom button");
    helper.assertLayout(testBtnFill, 20, 20, 260, 260, "Fill button");
}
開發者ID:emiloberg,項目名稱:NativeScript,代碼行數:32,代碼來源:dock-layout-tests.ts

示例2: test_dock_left_stretched

export function test_dock_left_stretched() {
    var testBtn = new helper.MyButton();
    rootLayout.addChild(testBtn);

    TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });

    helper.assertLayout(testBtn, 0, 0, 300, 300);
}
開發者ID:emiloberg,項目名稱:NativeScript,代碼行數:8,代碼來源:dock-layout-tests.ts

示例3: test_dock_left

export function test_dock_left() {
    var testBtn = new helper.MyButton();
    testBtn.width = 20;
    rootLayout.stretchLastChild = false;
    rootLayout.addChild(testBtn);

    TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });

    helper.assertLayout(testBtn, 0, 0, 20, 300);
}
開發者ID:emiloberg,項目名稱:NativeScript,代碼行數:10,代碼來源:dock-layout-tests.ts

示例4: test_dock_right

export function test_dock_right() {
    var testBtn = new helper.MyButton();
    testBtn.width = 20;
    dockModule.DockLayout.setDock(testBtn, enums.Dock.right);
    rootLayout.stretchLastChild = false;
    rootLayout.addChild(testBtn);

    TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });

    helper.assertLayout(testBtn, 280, 0, 20, 300);
}
開發者ID:emiloberg,項目名稱:NativeScript,代碼行數:11,代碼來源:dock-layout-tests.ts

示例5: test_padding

export function test_padding() {
    var testBtn = new helper.MyButton();
    rootLayout.addChild(testBtn);
    rootLayout.paddingLeft = 10;
    rootLayout.paddingTop = 20;
    rootLayout.paddingRight = 30;
    rootLayout.paddingBottom = 40;

    TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });

    helper.assertMeasure(testBtn, 260, 240);
    helper.assertLayout(testBtn, 10, 20, 260, 240);
}
開發者ID:emiloberg,項目名稱:NativeScript,代碼行數:13,代碼來源:dock-layout-tests.ts


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