当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript dock-layout.DockLayout类代码示例

本文整理汇总了TypeScript中ui/layouts/dock-layout.DockLayout的典型用法代码示例。如果您正苦于以下问题:TypeScript DockLayout类的具体用法?TypeScript DockLayout怎么用?TypeScript DockLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DockLayout类的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_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

示例3: 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

示例4: 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

示例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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。